From 86167c6e6d3362a02055e9045981434d29c7cca5 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 27 Nov 2019 14:04:38 +0100 Subject: [PATCH] clightning: wait until the RPC socket appears This fixes failures with spark-wallet which requires clightning RPC --- modules/clightning.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/clightning.nix b/modules/clightning.nix index fb513b9..f3de4a0 100644 --- a/modules/clightning.nix +++ b/modules/clightning.nix @@ -106,6 +106,11 @@ in { then nix-bitcoin-services.allowTor 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}') + ''; }; }; }