clightning: update to v0.8.0

To continue using inotify would be too complicated because we would also need to
monitor the creation of the 'bitcoin' subdirectory.
This commit is contained in:
Erik Arvstedt 2020-01-09 14:27:45 +01:00 committed by Jonas Nick
parent 7dd5f01527
commit eaaa6b8701
No known key found for this signature in database
GPG Key ID: 4861DBF262123605

View File

@ -92,7 +92,7 @@ in {
# give group read access to allow using lightning-cli # give group read access to allow using lightning-cli
chmod u=rw,g=r,o= ${cfg.dataDir}/config chmod u=rw,g=r,o= ${cfg.dataDir}/config
# The RPC socket has to be removed otherwise we might have stale sockets # The RPC socket has to be removed otherwise we might have stale sockets
rm -f ${cfg.dataDir}/lightning-rpc rm -f ${cfg.dataDir}/bitcoin/lightning-rpc
echo "bitcoin-rpcpassword=$(cat ${config.nix-bitcoin.secretsDir}/bitcoin-rpcpassword)" >> '${cfg.dataDir}/config' echo "bitcoin-rpcpassword=$(cat ${config.nix-bitcoin.secretsDir}/bitcoin-rpcpassword)" >> '${cfg.dataDir}/config'
''; '';
serviceConfig = { serviceConfig = {
@ -108,8 +108,9 @@ in {
); );
# Wait until the rpc socket appears # Wait until the rpc socket appears
postStart = '' postStart = ''
while read f; do [[ $f == lightning-rpc ]] && break; done \ while [[ ! -e ${cfg.dataDir}/bitcoin/lightning-rpc ]]; do
< <(${pkgs.inotifyTools}/bin/inotifywait --quiet --monitor -e create,moved_to --format '%f' '${cfg.dataDir}') sleep 0.1
done
''; '';
}; };
}; };