Fail2ban not working

I have read all the other threads with this name and nothing appears to work. Tried disabling zulu was one of the latest fixes I saw, that didn’t work. Running FreePBX 16.0.19 and all services good except for fail2ban.

[root@pbx asterisk]# systemctl start fail2ban.service
Job for fail2ban.service failed because the control process exited with error code. See “systemctl status fail2ban.service” and “journalctl -xe” for details.

Output for systemctl status fail2ban.service

[root@pbx asterisk]# systemctl -l status fail2ban.service
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Thu 2022-04-07 01:50:12 UTC; 1min 38s ago
Process: 27727 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
Process: 27725 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, status=0/SUCCESS)

Apr 07 01:50:12 pbx. systemd[1]: Failed to start Fail2Ban Service.
Apr 07 01:50:12 pbx. systemd[1]: Unit fail2ban.service entered failed state.
Apr 07 01:50:12 pbx. systemd[1]: fail2ban.service failed.
Apr 07 01:50:12 pbx. systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Apr 07 01:50:12 pbx. systemd[1]: Stopped Fail2Ban Service.
Apr 07 01:50:12 pbx. systemd[1]: start request repeated too quickly for fail2ban.service
Apr 07 01:50:12 pbx. systemd[1]: Failed to start Fail2Ban Service.
Apr 07 01:50:12 pbx. systemd[1]: Unit fail2ban.service entered failed state.
Apr 07 01:50:12 pbx. systemd[1]: fail2ban.service failed.

any help appreciated. Thanks

If you are using the ‘Distro’, only Sangoma can help you.

Us mere mortals can’t see what they are doing :wink:

I was planning on putting a ticket in with Sangoma today. I saw that there seemed to be a rise in this problem back in Aug 21 with a lot of posts on here. I tried every solution I could find there but alas none worked. Thanks for the reply, if I find something I will come back and post my solutions.

This is the key that will identify the broken jail

[root@pbx ~]# Fail2ban-client -x start
-bash: Fail2ban-client: command not found

small letter f : fail2ban-client -x start

[root@pbx ~]# fail2ban-client -x start
ERROR No section: ‘Definition’
ERROR Failed during configuration: ‘bool’ object is not iterable

Start with

 fail2ban-client -xv

continue adding a ‘v’ (for verbosity) until you get informed what is badly formed (‘fail2ban-client stop’ if you need it . . .)

Thank you guys for all the help. It turns out that there was an issue with the zulu config being empty. Once it was rewritten, fail2ban started to work properly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.