From fc1466e743a09bafe3fa05e7916f34646b8b243e Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 8 Oct 2023 21:39:11 +0200 Subject: [PATCH] Revert "clightning: don't cleanup socket on startup" Also, add a detailed comment. Without this commit, clightning client services may fail to start due to clightning RPC connection failures. --- modules/clightning.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/clightning.nix b/modules/clightning.nix index e99dee3..4858b97 100644 --- a/modules/clightning.nix +++ b/modules/clightning.nix @@ -170,6 +170,11 @@ in { requires = [ "bitcoind.service" ]; after = [ "bitcoind.service" ]; preStart = '' + # Remove an existing socket so that `postStart` can detect when when a new + # socket has been created and clightning is ready to accept RPC connections. + # This will no longer be needed when clightning supports systemd startup notifications. + rm -f ${cfg.networkDir}/lightning-rpc + umask u=rw,g=r,o= { cat ${configFile}