mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 11:39:25 +01:00
launcher: reword "PID exists" error
This commit is contained in:
parent
1630d176d0
commit
498a32a525
12
launcher.py
12
launcher.py
@ -37,14 +37,14 @@ def main():
|
|||||||
|
|
||||||
# Write and check for an existing PID file unless specifically told not to.
|
# Write and check for an existing PID file unless specifically told not to.
|
||||||
if not args.no_pid:
|
if not args.no_pid:
|
||||||
config = conf.confname
|
pidfile = '%s.pid' % conf.confname
|
||||||
if os.path.exists("%s.pid" % config):
|
if os.path.exists(pidfile):
|
||||||
log.error("PID file exists; aborting! If PyLink didn't shut down cleanly last time it "
|
log.error("PID file exists %r; aborting! If PyLink didn't shut down cleanly last time it "
|
||||||
"was run, or you're upgrading from PyLink < 1.1-dev, delete %s.pid and try "
|
"ran, or you're upgrading from PyLink < 1.1-dev, delete %r and start the "
|
||||||
"again." % config)
|
"server again." % (pidfile, pidfile))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
with open('%s.pid' % conf.confname, 'w') as f:
|
with open(pidfile, 'w') as f:
|
||||||
f.write(str(os.getpid()))
|
f.write(str(os.getpid()))
|
||||||
world._should_remove_pid = True
|
world._should_remove_pid = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user