mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-13 22:29: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.write('%s\n' % pid)
|
||||||
fd.close()
|
fd.close()
|
||||||
def removePidFile():
|
def removePidFile():
|
||||||
|
try:
|
||||||
os.remove(pidFile)
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user