From f24f4a4250fdf00e74c1a68ad509f8d3d97f27e5 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 29 Aug 2020 12:29:22 -0700 Subject: [PATCH] Fix checking pid file on startup --- Tautulli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tautulli.py b/Tautulli.py index c51e51e1..0a15f2c6 100755 --- a/Tautulli.py +++ b/Tautulli.py @@ -149,11 +149,13 @@ def main(): try: with open(plexpy.PIDFILE, 'r') as fp: pid = int(fp.read()) - os.kill(pid, 0) except IOError as e: raise SystemExit("Unable to read PID file: %s", e) + + try: + os.kill(pid, 0) 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." % (plexpy.PIDFILE, pid)) else: