mirror of https://github.com/fail2ban/fail2ban
init.d script fixed
parent
f322d7205a
commit
a1509ae1e4
|
@ -28,15 +28,41 @@ set -e
|
|||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: "
|
||||
if $0 status >/dev/null
|
||||
then
|
||||
$0 status
|
||||
exit 1
|
||||
fi
|
||||
[ -f $PIDFILE ] && [ ! -d /proc/`cat $PIDFILE` ] && rm -f $PIDFILE
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
||||
--exec $DAEMON -- $DAEMON_OPTS
|
||||
echo "$NAME."
|
||||
echo ".done"
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
if $0 status >/dev/null
|
||||
then
|
||||
fail2banpid=`cat $PIDFILE`
|
||||
else
|
||||
( $0 status )
|
||||
echo "Not stopping fail2ban"
|
||||
exit 1
|
||||
fi
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE
|
||||
echo "$NAME."
|
||||
maxsecs=30
|
||||
i=0
|
||||
while [ -f $PIDFILE ] && [ -d /proc/$fail2banpid ] \
|
||||
&& [ $i -le $maxsecs ]; do
|
||||
echo -n "."
|
||||
sleep 1
|
||||
i=$(($i+1))
|
||||
done
|
||||
if [ $i -eq $maxsecs ]; then
|
||||
echo "ERROR: Fail2ban failed to stop properly. Tail of the log file is"
|
||||
tail /var/log/fail2ban.log
|
||||
exit 1
|
||||
fi
|
||||
echo "done"
|
||||
;;
|
||||
restart|force-reload)
|
||||
echo -n "Restarting $DESC: "
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
fail2ban (0.5.4-6.2) unstable; urgency=low
|
||||
fail2ban (0.5.4-6.3) unstable; urgency=low
|
||||
|
||||
* Fixed typos (thanx to Ross Boylan).
|
||||
* Robust startup: if iptables module gets fully initialized after
|
||||
|
@ -9,6 +9,8 @@ fail2ban (0.5.4-6.2) unstable; urgency=low
|
|||
secondary solution for the bug 334272, fail2ban startup is moved
|
||||
during bootup to the latest (S99) sequenece position. That should not
|
||||
cause any discomfort I believe.
|
||||
* Adjusted init.d script so it is resistant to delayed shutdowns of
|
||||
fail2ban and in general more stable
|
||||
|
||||
-- Yaroslav Halchenko <debian@onerussian.com> Tue, 18 Oct 2005 15:54:38 -0400
|
||||
|
||||
|
|
Loading…
Reference in New Issue