From: Stefan Schantl Date: Wed, 1 May 2019 15:03:06 +0000 (+0200) Subject: suricata: Remove PID file on stop X-Git-Tag: v2.23-core131~1 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=0c52297641c96927eba3476851957ef0fe321ec8 suricata: Remove PID file on stop Force the initscript to remove the PID file when calling "stop" section. If suricata crashes during startup, the PID file still remains and the service cannot be started anymore until the file has been deleted. Now when calling "stop" or "restart" the PID file will be deleted and the service can be used again. Fixes #12067. Signed-off-by: Stefan Schantl Signed-off-by: Arne Fitzenreiter --- diff --git a/src/initscripts/system/suricata b/src/initscripts/system/suricata index c9f131fcae..38b6a40d83 100644 --- a/src/initscripts/system/suricata +++ b/src/initscripts/system/suricata @@ -171,6 +171,9 @@ case "$1" in # Remove suricata control socket. rm /var/run/suricata/* >/dev/null 2>/dev/null + # Trash remain pid file if still exists. + rm -f $PID_FILE >/dev/null 2>/dev/null + # Don't report returncode of rm if suricata was not started exit 0 ;;