From 6e152daf05f01191c88a1515f313c060baacdee8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Thu, 17 Dec 2020 09:37:45 -0500 Subject: [PATCH] Put the pidfile in the right place Seems we relied on the chdir for that to happen, previously. --- src/allmydata/scripts/tahoe_run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/allmydata/scripts/tahoe_run.py b/src/allmydata/scripts/tahoe_run.py index 071dfac60..80c867202 100644 --- a/src/allmydata/scripts/tahoe_run.py +++ b/src/allmydata/scripts/tahoe_run.py @@ -202,7 +202,9 @@ def run(config, runApp=twistd.runApp): if not nodetype: print("%s is not a recognizable node directory" % quoted_basedir, file=err) return 1 - twistd_args = ["--nodaemon", "--rundir", basedir] + + pidfile = get_pidfile(basedir) + twistd_args = ["--nodaemon", "--rundir", basedir, "--pidfile", pidfile] twistd_args.extend(config.twistd_args) twistd_args.append("DaemonizeTahoeNode") # point at our DaemonizeTahoeNodePlugin @@ -219,7 +221,6 @@ def run(config, runApp=twistd.runApp): twistd_config.loadedPlugins = {"DaemonizeTahoeNode": DaemonizeTahoeNodePlugin(nodetype, basedir)} # handle invalid PID file (twistd might not start otherwise) - pidfile = get_pidfile(basedir) if get_pid_from_pidfile(pidfile) == -1: print("found invalid PID file in %s - deleting it" % basedir, file=err) os.remove(pidfile)