Symptoms
-
Fail2Ban in Plesk fails to start with any of the following errors:
PLESK_ERROR: Internal error: f2bmng failed: ln -s ‘/usr/lib/systemd/system/fail2ban.service’ ‘/etc/systemd/system/multi-user.target.wants/fail2ban.service’
Job for fail2ban.service failed. See ‘systemctl status fail2ban.service’ and ‘journalctl -n’ for details.
ERROR:f2bmng:Failed to start fail2ban serviceMessage: f2bmng failed: ln -s ‘/usr/lib/systemd/system/fail2ban.service’ ‘/etc/systemd/system/multi-user.target.wants/fail2ban.service’
Job for fail2ban.service failed. See ‘systemctl status fail2ban.service’ and ‘journalctl -n’ for details.
ERROR:f2bmng:Failed to start fail2ban serviceFile Agent.phpLine 243Type PleskUtilException
# service fail2ban start
* Starting authentication failure monitor fail2ban
Traceback (most recent call last):
File “/usr/bin/fail2ban-client”, line 472, in <module>
if client.start(sys.argv):
File “/usr/bin/fail2ban-client”, line 442, in start
return self.__processCommand(args)
File “/usr/bin/fail2ban-client”, line 216, in __processCommand
if self.__ping():
File “/usr/bin/fail2ban-client”, line 153, in __ping
return self.__processCmd([[“ping”]], False)
File “/usr/bin/fail2ban-client”, line 185, in __processCmd
client.close()
File “/usr/lib/python2.7/dist-packages/fail2ban/client/csocket.py”, line 55, in close
self.__csock.sendall(CSPROTO.CLOSE + CSPROTO.END)
File “/usr/lib/python2.7/socket.py”, line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 32] Broken pipe
Cause
fail2ban
service was started manually with –x
option.
Resolution
-
Connect to the server using SSH.
-
Kill
fail2ban
service on the server and remove its socket:# kill `ps afvvx | grep -v grep | grep fail2ban-server | awk ‘{print $1}’ | xargs`
# rm -f /var/run/fail2ban/fail2ban.sockNote: In case of missing fail2ban process,
incorrect command usage
message will be shown. -
Start Fail2Ban service from Tools & Settings -> Services Management -> IP Address Banning (Fail2ban) in Plesk GUI:
-
In case of steps above did not help – reinstall Fail2Ban components: How to install/uninstall Plesk components?