From 47f331ef2866fda72f25d170085a0aca8abd737c Mon Sep 17 00:00:00 2001 From: ItsAdventureTime Date: Thu, 13 Nov 2014 16:14:07 +0800 Subject: [PATCH] Fixed the fail2ban init file issue. Fixed some issues with the DAEMON's path and the SOCKFILE's location. --- debian/fail2ban.init | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/fail2ban.init b/debian/fail2ban.init index 98e7216a..d9bb3f50 100755 --- a/debian/fail2ban.init +++ b/debian/fail2ban.init @@ -17,6 +17,10 @@ # reindented + minor corrections + to work on sarge without modifications # Modified: by Glenn Aaldering # added exit codes for status command +# Modified: by Juan Karlo de Guzman +# corrected the DAEMON's path and the SOCKFILE +# rename this file: (sudo) mv /etc/init.d/fail2ban.init /etc/init.d/fail2ban +# same with the logrotate file: (sudo) mv /etc/logrotate.d/fail2ban.logrotate /etc/logrotate.d/fail2ban # PATH=/usr/sbin:/usr/bin:/sbin:/bin DESC="authentication failure monitor" @@ -24,13 +28,13 @@ NAME=fail2ban # fail2ban-client is not a daemon itself but starts a daemon and # loads its with configuration -DAEMON=/usr/bin/$NAME-client +DAEMON=/usr/local/bin/$NAME-client SCRIPTNAME=/etc/init.d/$NAME # Ad-hoc way to parse out socket file name SOCKFILE=`grep -h '^[^#]*socket *=' /etc/$NAME/$NAME.conf /etc/$NAME/$NAME.local 2>/dev/null \ | tail -n 1 | sed -e 's/.*socket *= *//g' -e 's/ *$//g'` -[ -z "$SOCKFILE" ] && SOCKFILE='/tmp/fail2ban.sock' +[ -z "$SOCKFILE" ] && SOCKFILE='/var/run/fail2ban.sock' # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0