Fail2Ban not starting up

I recently had failure of my FreePBX 15 distro. Was running it on HyperV and the file system appears to have gotten corrupted. I’m a Linux novice, so rather than figuring out how to repair the filesystem, I decided to start over and install the FreePBX 16 distro onto the same hyperV machine and restored a recent backup. All worked pretty well with a few minor glitches. Thanks to the developers for making this part easy.

The major glitch that I can’t seem to figure out is that fail2ban won’t start. Firewall is up and I don’t have the adaptive firewall running right now, so I don’t think the fix is emergent, but I would like to turn on the adaptive firewall for some users outside the local network.

PBX Version: 16.0.26
PBX Distro: 12.7.8-2208-2.sng7
Asterisk Version: 18.14.0

In firewall > intrusion detection in the GUI, clicking start results in no change to the STOPPED status

In the CLI:
entered:

systemctl -l status fail2ban

results:
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Tue 2022-12-06 16:20:36 CST; 24min ago
Process: 53313 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
Process: 53312 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, status=0/SUCCESS)
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: fail2ban.service: control process exited, code=exited status=255
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: Failed to start Fail2Ban Service.
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: Unit fail2ban.service entered failed state.
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: fail2ban.service failed.
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: Stopped Fail2Ban Service.
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: start request repeated too quickly for fail2ban.service
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: Failed to start Fail2Ban Service.
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: Unit fail2ban.service entered failed state.
Dec 06 16:20:36 freepbx.parkwayentandallergy.com systemd[1]: fail2ban.service failed.

I also ran:

/usr/bin/fail2ban-client -x start

which resulted in:

ERROR Found no accessible config files for ‘filter.d/apache-api’ under /etc/fail2ban
ERROR Unable to read the filter
ERROR Errors in jail ‘apache-api’. Skipping…
ERROR Found no accessible config files for ‘filter.d/zulu’ under /etc/fail2ban
ERROR Unable to read the filter
ERROR Errors in jail ‘zulu’. Skipping…
ERROR Found no accessible config files for ‘filter.d/openvpn’ under /etc/fail2ban
ERROR Unable to read the filter
ERROR Errors in jail ‘openvpn’. Skipping…

Is anyone able to give me some insight?

Thanks,

David Sycamore

Either create those config files (they can be empty) or disable the jails, search these fora for the same problem.

Thanks for the reply dicko.

I found that people had fixed the

ERROR Found no accessible config files for ‘filter.d/apache-api’ under /etc/fail2ban

by running

/var/www/html/admin/modules/sysadmin/hooks/fail2ban-apache-config

This fixed the first 3 errors out of 9

I reviewed more previous fail2ban threads and found that many had success with commenting out Zulu in the etc/fail2ban/jail.local.

Tried this and the next three error regarding Zulu disappeared (errors 4-6), but the the similar OpenVPN ERRORS (errors 6-9) remained. I don’t use it, so I commented out the OpenVPN section as well. Then started it up successfully with

/usr/bin/fail2ban-client -x start

I’ll restart the server after hours to make sure it starts automatically.

Thanks again.

You don’t need to comment out the whole stanza just set (or add)

enabled = false

Thar way it’s a quicker fix when you get the underlying problem sorted.

Thanks for the tip. This did work, but then when I restarted the system, I realized that Sysadmin Pro rewrites the config file.

I added empty openvpn.conf and Zulu.conf to the filter.d folder.

fail2ban still wouldn’t start up with the error that [definition] was missing. After some looking at other configuration files I realized it was over my head to write the .conf files.

I set enabled = false in the jail.local for Zulu and OpenVPN

I then used

chattr +i /etc/fail2ban/jail.local

to make it immutable.

Anyone know where to get the missing zulu.conf and openvpn.conf files?

Thanks,

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