3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

pylink: exit with a non-zero code if pid check fails; reword error to be more helpful

This commit is contained in:
James Lu 2016-10-15 14:23:29 -07:00
parent bc4be815e4
commit 774f30c940

6
pylink
View File

@ -41,8 +41,10 @@ if __name__ == '__main__':
if not args.no_checkpid:
config = conf.confname
if os.path.exists("%s.pid" % config):
log.error("PID file exists!.. EXITING")
sys.exit()
log.error("PID file exists; aborting! If Pylink didn't shut down cleanly last time it "
"was run, delete %s.pid and try again." % config)
sys.exit(1)
# Write a PID file unless specifically told not to.
if not args.no_pid:
with open('%s.pid' % conf.confname, 'w') as f: