mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-11 20:52:42 +01:00
pylink: exit with a non-zero code if pid check fails; reword error to be more helpful
This commit is contained in:
parent
bc4be815e4
commit
774f30c940
6
pylink
6
pylink
@ -41,8 +41,10 @@ if __name__ == '__main__':
|
|||||||
if not args.no_checkpid:
|
if not args.no_checkpid:
|
||||||
config = conf.confname
|
config = conf.confname
|
||||||
if os.path.exists("%s.pid" % config):
|
if os.path.exists("%s.pid" % config):
|
||||||
log.error("PID file exists!.. EXITING")
|
log.error("PID file exists; aborting! If Pylink didn't shut down cleanly last time it "
|
||||||
sys.exit()
|
"was run, delete %s.pid and try again." % config)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Write a PID file unless specifically told not to.
|
# Write a PID file unless specifically told not to.
|
||||||
if not args.no_pid:
|
if not args.no_pid:
|
||||||
with open('%s.pid' % conf.confname, 'w') as f:
|
with open('%s.pid' % conf.confname, 'w') as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user