Failed to start fail2ban service

Created:

2016-11-16 12:55:48 UTC

Modified:

2017-04-24 21:04:12 UTC

5

Was this article helpful?


Have more questions?

Submit a request

Failed to start fail2ban service

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk Onyx 17.5 for Linux

Symptoms

  • Fail2Ban fails to start with the following 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

    OR

    # 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
  • Plesk shows the following error when trying to start Fail2Ban:

    Error: Unable to save the settings: f2bmng failed: 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 256, 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
    ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 1.

Cause

fail2ban service was started manually with “–x” option.

Resolution

  1. Kill fail2ban service on server:

    kill `ps afvvx | grep -v grep | grep fail2ban-server | awk '{print $1}' | xargs`
    

    Note : In case of missing fail2ban processes, you will see incorrect command usage message.

  2. Start fail2ban from Tools & Settings -> Services Management -> IP Address Banning (Fail2ban) in Plesk GUI.

Have more questions? Submit a request
Please sign in to leave a comment.