forked from pool/fail2ban
Accepting request 129475 from home:asemen:branches: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. OBS-URL: https://build.opensuse.org/request/show/129475 OBS-URL: https://build.opensuse.org/package/show/security/fail2ban?expand=0&rev=19
This commit is contained in:
parent
5f8ef27b27
commit
5f47f96283
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user