Skip to content

Commit

Permalink
lightningd: keep pid files in top-level config dir.
Browse files Browse the repository at this point in the history
They're already qualified with network name, and there's little point
moving them; it might even be dangerous if multiple are running.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Nov 18, 2019
1 parent 121b453 commit 0b891dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,10 +862,12 @@ static void promote_missing_files(struct lightningd *ld)
while ((d = readdir(d_from)) != NULL) {
const char *fullname;

/* Ignore this directory and upper one, and leave config */
/* Ignore this directory and upper one, and leave
* config and pid files */
if (streq(d->d_name, ".")
|| streq(d->d_name, "..")
|| streq(d->d_name, "config"))
|| streq(d->d_name, "config")
|| strends(d->d_name, ".pid"))
continue;

fullname = path_join(tmpctx, "..", d->d_name);
Expand Down Expand Up @@ -965,7 +967,7 @@ void handle_early_opts(struct lightningd *ld, int argc, char *argv[])
ld->config_dir);

/* Set default PID file name to be per-network */
ld->pidfile = tal_fmt(ld, "lightningd-%s.pid",
ld->pidfile = tal_fmt(ld, "../lightningd-%s.pid",
chainparams->network_name);

/*~ Move into config dir: this eases path manipulation and also
Expand Down

0 comments on commit 0b891dd

Please sign in to comment.