From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] suricata: Remove PID file on stop Date: Wed, 01 May 2019 17:03:06 +0200 Message-ID: <20190501150306.4230-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9026962950658884289==" List-Id: --===============9026962950658884289== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 ser= vice can be used again. Fixes #12067. Signed-off-by: Stefan Schantl --- src/initscripts/system/suricata | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/initscripts/system/suricata b/src/initscripts/system/suricata index c9f131fca..38b6a40d8 100644 --- a/src/initscripts/system/suricata +++ b/src/initscripts/system/suricata @@ -171,6 +171,9 @@ case "$1" in # Remove suricata control socket. =20 rm /var/run/suricata/* >/dev/null 2>/dev/null =20 + # 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 ;; --=20 2.20.1 --===============9026962950658884289==--