diff --git a/fail2ban.changes b/fail2ban.changes index 6f60e0c..3982d29 100644 --- a/fail2ban.changes +++ b/fail2ban.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 31 16:18:11 CEST 2012 - asemen@suse.de + +- Adding to fail2ban.init remove of pid and sock files on stop + in case not removed before (prevents start fail) + ------------------------------------------------------------------- Sun Jun 3 13:08:36 UTC 2012 - jweberhofer@weberhofer.at diff --git a/fail2ban.init b/fail2ban.init index d5e2c1e..34d5682 100644 --- a/fail2ban.init +++ b/fail2ban.init @@ -26,6 +26,7 @@ test -x $FAIL2BAN_SRV || { echo "$FAIL2BAN_SRV not installed"; FAIL2BAN_CONFIG="/etc/sysconfig/fail2ban" FAIL2BAN_SOCKET_DIR="/var/run/fail2ban" FAIL2BAN_SOCKET="$FAIL2BAN_SOCKET_DIR/fail2ban.sock" +FAIL2BAN_PID="$FAIL2BAN_SOCKET_DIR/fail2ban.pid" if [ -e $FAIL2BAN_CONFIG ]; then . $FAIL2BAN_CONFIG @@ -56,6 +57,18 @@ case "$1" in ## Stop daemon with built-in functionality 'stop' /sbin/startproc -w $FAIL2BAN_CLI -q stop > /dev/null 2>&1 + if [ -f $FAIL2BAN_SOCKET ] + then + echo "$FAIL2BAN_SOCKET not removed .. removing .." + rm $FAIL2BAN_SOCKET + fi + if [ -f $FAIL2BAN_PID ] + then + echo "$FAIL2BAN_PID not removed .. removing .." + rm $FAIL2BAN_PID + fi + + rc_status -v ;; try-restart|condrestart)