Handle when pid file is corrupt

Fix #1090
pull/1137/head
Julien Duponchelle 7 years ago
parent ec4e69b0d8
commit 87838cb574
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

@ -158,10 +158,10 @@ def pid_lock(path):
pid = None
try:
with open(path) as f:
pid = int(f.read())
try:
pid = int(f.read())
os.kill(pid, 0) # If the proces is not running kill return an error
except (OSError, SystemError):
except (OSError, SystemError, ValueError):
pid = None
except OSError as e:
log.critical("Can't open pid file %s: %s", pid, str(e))

Loading…
Cancel
Save