summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/util.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index 635b11ee5..67aa87a3a 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -84,6 +84,8 @@ def colon_separated_to_dict(data_string, uniquekeys=False):
def process_running(pid_file):
""" Checks if a process with PID in pid_file is running """
+ if not os.path.isfile(pid_file):
+ return False
with open(pid_file, 'r') as f:
pid = f.read().strip()
return psutil.pid_exists(int(pid))