mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-10 09:34:22 +01:00
master: Move pid-file creation after the daemonization
Creating the pid-file before daemonizing results in the pid-file containing the pid of the process that started the daemon, but is now dead. Signed-off-by: Christian Decker <decker.christian@gmail.com> Reported-By: Torkel Rogstad @torkelrogstad
This commit is contained in:
@@ -290,9 +290,6 @@ int main(int argc, char *argv[])
|
||||
/* Handle options and config; move to .lightningd */
|
||||
newdir = handle_opts(ld, argc, argv);
|
||||
|
||||
/* Create PID file */
|
||||
pidfile_create(ld);
|
||||
|
||||
/* Ignore SIGPIPE: we look at our write return values*/
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
@@ -373,6 +370,9 @@ int main(int argc, char *argv[])
|
||||
if (ld->daemon)
|
||||
daemonize_but_keep_dir(ld);
|
||||
|
||||
/* Create PID file */
|
||||
pidfile_create(ld);
|
||||
|
||||
/* Mark ourselves live. */
|
||||
log_info(ld->log, "Server started with public key %s, alias %s (color #%s) and lightningd %s",
|
||||
type_to_string(tmpctx, struct pubkey, &ld->id),
|
||||
|
||||
Reference in New Issue
Block a user