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.write('%s\n' % pid)
fd.close() fd.close()
def removePidFile(): def removePidFile():
os.remove(pidFile) try:
os.remove(pidFile)
except EnvironmentError, e:
log.error('Could not remove pid file: %s', e)
atexit.register(removePidFile) atexit.register(removePidFile)
except EnvironmentError, e: except EnvironmentError, e:
log.error('Error opening pid file %s: %s', pidFile, e) log.error('Error opening pid file %s: %s', pidFile, e)