mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-08 20:19:23 +01:00
Handle the case where our pidfile is deleted early.
This commit is contained in:
parent
4c0e8980a3
commit
22c333b536
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user