Handle the case where our pidfile is deleted early.

This commit is contained in:
Jeremy Fincher 2004-08-27 06:29:11 +00:00
parent 4c0e8980a3
commit 22c333b536

View File

@ -320,7 +320,10 @@ if __name__ == '__main__':
fd.write('%s\n' % pid)
fd.close()
def removePidFile():
os.remove(pidFile)
try:
os.remove(pidFile)
except EnvironmentError, e:
log.error('Could not remove pid file: %s', e)
atexit.register(removePidFile)
except EnvironmentError, e:
log.error('Error opening pid file %s: %s', pidFile, e)