From f00bb52f7c8589d8209466fee0a5465595cd043f Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Wed, 27 Jan 2021 09:34:03 -0800 Subject: [PATCH] [proc-exit-listener]: ignore blank lines make proc-exit-listener more rebust Signed-off-by: Guohan Lu --- files/scripts/supervisor-proc-exit-listener | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/scripts/supervisor-proc-exit-listener b/files/scripts/supervisor-proc-exit-listener index 06e402bd4f..4ac77298c7 100755 --- a/files/scripts/supervisor-proc-exit-listener +++ b/files/scripts/supervisor-proc-exit-listener @@ -2,6 +2,7 @@ import getopt import os +import re import select import signal import sys @@ -40,6 +41,9 @@ def get_critical_group_and_process_list(): with open(CRITICAL_PROCESSES_FILE, 'r') as file: for line in file: + # ignore blank lines + if re.match(r"^\s*$", line) + continue line_info = line.strip(' \n').split(':') if len(line_info) != 2: syslog.syslog(syslog.LOG_ERR,