SHA256
1
0
forked from pool/fail2ban

Accepting request 130285 from security

this fixes the start and restart problems (a start restart fail) if fail2ban was not stopped nice and if the sock and pid file were not removed. (forwarded request 129475 from asemen)

OBS-URL: https://build.opensuse.org/request/show/130285
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fail2ban?expand=0&rev=20
This commit is contained in:
Stephan Kulow 2012-08-07 19:51:37 +00:00 committed by Git OBS Bridge
commit 8f68ff30f3
2 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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)