pidfile on windows now
This commit is contained in:
parent
228bbbc2fe
commit
114d5e1ed8
|
@ -239,12 +239,14 @@ def run(config, runApp=twistd.runApp):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
twistd_args = [
|
twistd_args = [
|
||||||
# turn off Twisted's pid-file to use our own
|
|
||||||
"--pidfile", None,
|
|
||||||
# ensure twistd machinery does not daemonize.
|
# ensure twistd machinery does not daemonize.
|
||||||
"--nodaemon",
|
"--nodaemon",
|
||||||
"--rundir", basedir,
|
"--rundir", basedir,
|
||||||
]
|
]
|
||||||
|
if sys.platform != "win32":
|
||||||
|
# turn off Twisted's pid-file to use our own -- but only on
|
||||||
|
# windows, because twistd doesn't know about pidfiles there
|
||||||
|
twistd_args.extend(["--pidfile", None])
|
||||||
twistd_args.extend(config.twistd_args)
|
twistd_args.extend(config.twistd_args)
|
||||||
twistd_args.append("DaemonizeTahoeNode") # point at our DaemonizeTahoeNodePlugin
|
twistd_args.append("DaemonizeTahoeNode") # point at our DaemonizeTahoeNodePlugin
|
||||||
|
|
||||||
|
|
|
@ -418,8 +418,6 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
|
||||||
|
|
||||||
tahoe.active()
|
tahoe.active()
|
||||||
|
|
||||||
# We don't keep track of PIDs in files on Windows.
|
|
||||||
if not platform.isWindows():
|
|
||||||
self.assertTrue(tahoe.twistd_pid_file.exists())
|
self.assertTrue(tahoe.twistd_pid_file.exists())
|
||||||
self.assertTrue(tahoe.node_url_file.exists())
|
self.assertTrue(tahoe.node_url_file.exists())
|
||||||
|
|
||||||
|
@ -493,8 +491,6 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
|
||||||
# change on restart
|
# change on restart
|
||||||
storage_furl = fileutil.read(tahoe.storage_furl_file.path)
|
storage_furl = fileutil.read(tahoe.storage_furl_file.path)
|
||||||
|
|
||||||
# We don't keep track of PIDs in files on Windows.
|
|
||||||
if not platform.isWindows():
|
|
||||||
self.assertTrue(tahoe.twistd_pid_file.exists())
|
self.assertTrue(tahoe.twistd_pid_file.exists())
|
||||||
|
|
||||||
# rm this so we can detect when the second incarnation is ready
|
# rm this so we can detect when the second incarnation is ready
|
||||||
|
@ -513,7 +509,6 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
|
||||||
fileutil.read(tahoe.storage_furl_file.path),
|
fileutil.read(tahoe.storage_furl_file.path),
|
||||||
)
|
)
|
||||||
|
|
||||||
if not platform.isWindows():
|
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
tahoe.twistd_pid_file.exists(),
|
tahoe.twistd_pid_file.exists(),
|
||||||
"PID file ({}) didn't exist when we expected it to. "
|
"PID file ({}) didn't exist when we expected it to. "
|
||||||
|
@ -524,11 +519,9 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
|
||||||
)
|
)
|
||||||
yield tahoe.stop_and_wait()
|
yield tahoe.stop_and_wait()
|
||||||
|
|
||||||
if not platform.isWindows():
|
|
||||||
# twistd.pid should be gone by now.
|
# twistd.pid should be gone by now.
|
||||||
self.assertFalse(tahoe.twistd_pid_file.exists())
|
self.assertFalse(tahoe.twistd_pid_file.exists())
|
||||||
|
|
||||||
|
|
||||||
def _remove(self, res, file):
|
def _remove(self, res, file):
|
||||||
fileutil.remove(file)
|
fileutil.remove(file)
|
||||||
return res
|
return res
|
||||||
|
@ -610,7 +603,6 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
if not platform.isWindows():
|
|
||||||
# It should not be running.
|
# It should not be running.
|
||||||
self.assertFalse(tahoe.twistd_pid_file.exists())
|
self.assertFalse(tahoe.twistd_pid_file.exists())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue