Articles in this section

Unable to activate Fail2Ban jails in Plesk: Backend 'systemd' failed to initialize due to No module named systemd

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • When enabling Fail2Ban jails, the operation fails with:

    PLESK_ERROR: Unable to switch on the selected jails: f2bmng failed: fail2ban [7690]: ERROR NOK: ("Failed to initialize any backend for Jail 'plesk-roundcube'",)
    ERROR:main:Command '['/usr/bin/fail2ban-client', 'reload', '--if-exists', 'plesk-roundcube']' returned non-zero exit status 255
    ERROR:main:Failed to reload following jails due to errors in configuration: plesk-roundcube.

  • The following error message is logged in /var/log/fail2ban.log:

    CONFIG_TEXT: Backend 'systemd' failed to initialize due to No module named systemd

Cause

systemd is set as default backend in jail.local file:

CONFIG_TEXT: grep -r 'backend' /etc/fail2ban/jail.local
backend = systemd

Note: file could be different, e.g. /etc/fail2ban/jail.d/local.conf

Resolution

  1. Connect to the Plesk server via SSH.

  2. Open the file /etc/fail2ban/jail.local in a text editor. In this example, we are using the vi editor:

    # vi /etc/fail2ban/jail.local

  3. Remove or comment the following line, or change it to backend = auto:

    CONFIG_TEXT: backend = systemd

  4. Save the changes and close the file.

  5. Restart the Fail2Ban service:

    # systemctl restart fail2ban.service

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.