From 87838cb574ba9330607f0051aa0d75e3d8154cf2 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 20 Jul 2017 16:17:07 +0200 Subject: [PATCH] Handle when pid file is corrupt Fix #1090 --- gns3server/run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/run.py b/gns3server/run.py index 16cc9bc5..23a74827 100644 --- a/gns3server/run.py +++ b/gns3server/run.py @@ -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))