fail2ban/0.10.2
2017-11-27 16:13:07 +01:00
..
action.d Initial commit 2017-11-27 04:23:54 +01:00
filter.d Initial commit 2017-11-27 04:23:54 +01:00
ip64tables Initial commit 2017-11-27 04:23:54 +01:00
jail.local Add readme file for systemd integration. Some minor changes on jail values. 2017-11-27 16:13:07 +01:00
README.install Initial commit 2017-11-27 04:23:54 +01:00
README.sytemd Add readme file for systemd integration. Some minor changes on jail values. 2017-11-27 16:13:07 +01:00

# - Configure  fail2ban as systemd service
# -

cat << EOF > /etc/systemd/system/fail2ban.service
[Unit]
Description=Fail2Ban Service
Documentation=man:fail2ban(1)
After=network.target iptables.service firewalld.service ip6tables.service ipset.service
PartOf=iptables.service firewalld.service ip6tables.service ipset.service

[Service]
Type=simple
ExecStartPre=/bin/mkdir -p /var/run/fail2ban
ExecStart=/usr/local/bin/fail2ban-server -xf start
# if should be logged in systemd journal, use following line or set logtarget to sysout in fail2ban.local
# ExecStart=/usr/local/bin/fail2ban-server -xf --logtarget=sysout start
ExecStop=/usr/local/bin/fail2ban-client stop
ExecReload=/usr/local/bin/fail2ban-client reload
PIDFile=/var/run/fail2ban/fail2ban.pid
Restart=on-failure
RestartPreventExitStatus=0 255

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable fail2ban.service