mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Fix checking pid file on startup
This commit is contained in:
parent
95fc108d57
commit
f24f4a4250
1 changed files with 4 additions and 2 deletions
|
@ -149,11 +149,13 @@ def main():
|
||||||
try:
|
try:
|
||||||
with open(plexpy.PIDFILE, 'r') as fp:
|
with open(plexpy.PIDFILE, 'r') as fp:
|
||||||
pid = int(fp.read())
|
pid = int(fp.read())
|
||||||
os.kill(pid, 0)
|
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
raise SystemExit("Unable to read PID file: %s", e)
|
raise SystemExit("Unable to read PID file: %s", e)
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.kill(pid, 0)
|
||||||
except OSError:
|
except OSError:
|
||||||
logger.warn("PID file '%s' already exists, but PID %d is " \
|
logger.warn("PID file '%s' already exists, but PID %d is "
|
||||||
"not running. Ignoring PID file." %
|
"not running. Ignoring PID file." %
|
||||||
(plexpy.PIDFILE, pid))
|
(plexpy.PIDFILE, pid))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue