After enabling a jail, the Fail2ban service can't be restarted or stopped.
The service status is shown incorrectly, without the jails list:
# service fail2ban status fail2ban-server (pid 3291) is running
/var/log/fail2ban.log shows that the service stopped when adding log files to its monitoring pool:
2014-07-27 21:09:25,487 fail2ban.filter : INFO Added logfile = /var/www/vhosts/system/example.com/logs/proxy_access_log 2014-07-27 21:09:25,985 fail2ban.filter : INFO Added logfile = /var/www/vhosts/system/example.com/logs/proxy_access_ssl_log
The following errors may appear in
fail2ban.action : ERROR iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-BadBots iptables -F f2b-BadBots iptables -X f2b-BadBots -- stdout: '' fail2ban.action : ERROR iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-BadBots iptables -F f2b-BadBots iptables -X f2b-BadBots -- stderr: 'iptables: Too many links.\n' fail2ban.actions : ERROR Failed to stop jail 'plesk-wordpress' action 'iptables-multiport': Error stopping action
This is a software issue with ID #PPPM-4692. It was fixed in Plesk Onyx 17.0.9, and a fix for Plesk 12.5 will be included in one of the next updates.
The fix could be applied manually by editing the file
/usr/lib/pythonX.X/dist-packages/fail2ban/server/database.py (where X.X is a Python version). Lines to be added is marked with '+' sign:
cur = self._db.cursor() cur.execute("PRAGMA foreign_keys = ON;") + cur.execute("PRAGMA synchronous = OFF;") + cur.execute("PRAGMA journal_mode = MEMORY;") try: cur.execute("SELECT version FROM fail2banDb LIMIT 1")
Alternatively, consider upgrading to the latest version of Plesk.