mirror of https://github.com/fail2ban/fail2ban
- Updated suse-initd and added it to MANIFEST. Thanks to Christian Rauch
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@597 a942ae1a-1317-0410-a47c-b1dcaea8d605_tent/ipv6_via_aInfo
parent
ada2d7234e
commit
568264d6c7
|
@ -15,6 +15,8 @@ ver. 0.8.1 (2007/??/??) - stable
|
||||||
- Added sendmail actions. The action started with "mail" are
|
- Added sendmail actions. The action started with "mail" are
|
||||||
now deprecated. Thanks to Raphaël Marichez
|
now deprecated. Thanks to Raphaël Marichez
|
||||||
- Added "ignoreregex" support to fail2ban-regex
|
- Added "ignoreregex" support to fail2ban-regex
|
||||||
|
- Updated suse-initd and added it to MANIFEST. Thanks to
|
||||||
|
Christian Rauch
|
||||||
|
|
||||||
ver. 0.8.0 (2007/05/03) - stable
|
ver. 0.8.0 (2007/05/03) - stable
|
||||||
----------
|
----------
|
||||||
|
|
1
MANIFEST
1
MANIFEST
|
@ -102,6 +102,7 @@ files/gentoo-confd
|
||||||
files/redhat-initd
|
files/redhat-initd
|
||||||
files/solaris-fail2ban.xml
|
files/solaris-fail2ban.xml
|
||||||
files/solaris-svc-fail2ban
|
files/solaris-svc-fail2ban
|
||||||
|
files/suse-initd
|
||||||
files/cacti/fail2ban_stats.sh
|
files/cacti/fail2ban_stats.sh
|
||||||
files/cacti/cacti_host_template_fail2ban.xml
|
files/cacti/cacti_host_template_fail2ban.xml
|
||||||
files/cacti/README
|
files/cacti/README
|
||||||
|
|
109
files/suse-initd
109
files/suse-initd
|
@ -6,26 +6,26 @@
|
||||||
#
|
#
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: fail2ban
|
# Provides: fail2ban
|
||||||
# Required-Start: $syslog $remote_fs postfix
|
# Required-Start: $syslog $remote_fs sendmail
|
||||||
# Required-Stop: $syslog $remote_fs
|
# Required-Stop: $syslog $remote_fs
|
||||||
# Should-Stop: $time ypbind sendmail
|
# Should-Stop: $time ypbind sendmail
|
||||||
# Default-Start: 3 5
|
# Default-Start: 3 5
|
||||||
# Default-Stop: 0 1 2 6
|
# Default-Stop: 0 1 2 6
|
||||||
# Description: startup Fail2Ban
|
# Description: startup Fail2Ban
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/sbin:/usr/bin:/bin
|
||||||
FAIL2BAN_BIN=/usr/local/bin/fail2ban-client
|
FAIL2BAN_BIN=/usr/local/bin/fail2ban-client
|
||||||
FAIL2BAN_SERVER=/usr/local/bin/fail2ban-server
|
FAIL2BAN_SERVER=/usr/local/bin/fail2ban-server
|
||||||
FAIL2BAN_SOCKET=/tmp/fail2ban.sock
|
FAIL2BAN_SOCKET=/tmp/fail2ban.sock
|
||||||
test -x $FAIL2BAN_BIN || { echo "$FAIL2BAN_BIN not installed";
|
test -x $FAIL2BAN_BIN || { echo "$FAIL2BAN_BIN not installed";
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
if [ "$1" = "stop" ]; then exit 0;
|
||||||
else exit 5; fi; }
|
else exit 5; fi; }
|
||||||
|
|
||||||
# Check for existence of needed config file and read it
|
# Check for existence of needed config file and read it
|
||||||
FAIL2BAN_CONFIG=/etc/fail2ban/fail2ban.conf
|
FAIL2BAN_CONFIG=/etc/fail2ban/fail2ban.conf
|
||||||
test -r $FAIL2BAN_CONFIG || { echo "$FAIL2BAN_CONFIG not existing";
|
test -r $FAIL2BAN_CONFIG || { echo "$FAIL2BAN_CONFIG not existing";
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
if [ "$1" = "stop" ]; then exit 0;
|
||||||
else exit 6; fi; }
|
else exit 6; fi; }
|
||||||
|
|
||||||
. /etc/rc.status
|
. /etc/rc.status
|
||||||
|
|
||||||
|
@ -34,54 +34,63 @@ rc_reset
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting Fail2Ban "
|
echo -n "Starting Fail2Ban "
|
||||||
/sbin/startproc $FAIL2BAN_BIN -q start 2>1 > /dev/null
|
/sbin/startproc $FAIL2BAN_BIN start &>/dev/null
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Shutting down Fail2ban "
|
echo -n "Shutting down Fail2ban "
|
||||||
/sbin/startproc $FAIL2BAN_BIN -q stop
|
/sbin/startproc $FAIL2BAN_BIN -q stop
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
try-restart|condrestart)
|
try-restart|condrestart)
|
||||||
if test "$1" = "condrestart"; then
|
if test "$1" = "condrestart"; then
|
||||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
||||||
fi
|
fi
|
||||||
$0 status
|
$0 status
|
||||||
if test $? = 0; then
|
if test $? = 0; then
|
||||||
$0 restart
|
$0 restart
|
||||||
else
|
else
|
||||||
rc_reset # Not running is not a failure.
|
rc_reset # Not running is not a failure.
|
||||||
fi
|
fi
|
||||||
rc_status
|
rc_status
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
$0 stop
|
$0 stop
|
||||||
i=60
|
echo -n "-wait a minute "
|
||||||
while [ -e $FAIL2BAN_SOCKET ] && [ $i -gt 60 ]
|
i=60
|
||||||
sleep 1
|
while [ -e $FAIL2BAN_SOCKET ] && [ $i -gt 0 ]; do
|
||||||
i=$[i-1]
|
sleep 1
|
||||||
echo -n "."
|
i=$[$i-1]
|
||||||
done
|
echo -n "."
|
||||||
echo "."
|
done
|
||||||
$0 start
|
echo "."
|
||||||
|
$0 start
|
||||||
|
|
||||||
# Remember status and be quiet
|
# Remember status and be quiet
|
||||||
rc_status
|
rc_status
|
||||||
;;
|
;;
|
||||||
force-reload)
|
force-reload)
|
||||||
echo -n "Reload service Fail2ban "
|
echo -n "Reload service Fail2ban "
|
||||||
/sbin/startproc $FAIL2BAN_BIN -q reload
|
/sbin/startproc $FAIL2BAN_BIN -q reload
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
reload)
|
reload)
|
||||||
echo -n "Reload service Fail2ban "
|
echo -n "Reload service Fail2ban "
|
||||||
/sbin/startproc $FAIL2BAN_BIN -q reload
|
/sbin/startproc $FAIL2BAN_BIN -q reload
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
echo -n "Checking for service Fail2ban "
|
echo -n "Checking for service Fail2ban "
|
||||||
/sbin/checkproc $FAIL2BAN_SERVER
|
/sbin/checkproc $FAIL2BAN_SERVER
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
probe)
|
probe)
|
||||||
|
test /etc/fail2ban/fail2ban.conf -nt /var/run/fail2ban.pid && echo reload
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
rc_exit
|
Loading…
Reference in New Issue