mirror of
https://github.com/fail2ban/fail2ban.git
synced 2025-11-26 14:20:19 +08:00
(a) use static-network-up, since it is more generic than the started networking event (b) do not hook into network deconfiguration to speed up shutdown (c) expect fork, per the use of the "-f" option (d) use a variable for the run directory to make changing it simpler (e) handle the situation of a left over socket file (f) use the -f option to be able to track the PID
21 lines
461 B
Plaintext
21 lines
461 B
Plaintext
description "fail2ban - ban hosts that cause multiple authentication errors"
|
|
|
|
start on filesystem and static-network-up
|
|
stop on runlevel [016]
|
|
|
|
expect fork
|
|
respawn
|
|
|
|
env RUNDIR=/var/run/fail2ban
|
|
|
|
pre-start script
|
|
test -d $RUNDIR || mkdir -p $RUNDIR
|
|
test ! -e $RUNDIR/fail2ban.sock || rm -f $RUNDIR/fail2ban.sock
|
|
end script
|
|
|
|
exec /usr/bin/fail2ban-client -f -x start
|
|
|
|
pre-stop exec /usr/bin/fail2ban-client stop
|
|
|
|
post-stop exec rm -f $RUNDIR/fail2ban.pid
|