clightning: wait until the RPC socket appears

This fixes failures with spark-wallet which requires clightning RPC
This commit is contained in:
Erik Arvstedt 2019-11-27 14:04:38 +01:00
parent 60c732a6a1
commit 86167c6e6d
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -106,6 +106,11 @@ in {
then nix-bitcoin-services.allowTor then nix-bitcoin-services.allowTor
else nix-bitcoin-services.allowAnyIP else nix-bitcoin-services.allowAnyIP
); );
# Wait until the rpc socket appears
postStart = ''
while read f; do [[ $f == lightning-rpc ]] && break; done \
< <(${pkgs.inotifyTools}/bin/inotifywait --quiet --monitor -e create,moved_to --format '%f' '${cfg.dataDir}')
'';
}; };
}; };
} }