[System 40] fail2ban should always be running

PBX Version:15.0.17.43
PBX Distro:12.7.8-2107-3.sng7
Asterisk Version:16.19.0

This is a new Sangoma System 40. After the initial batch of updates, the dashboard says “fail2ban should always be running” and it will not start. Here’s what I get from CLI.

[[email protected] ~]# systemctl status fail2ban.service
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; disabled; vendor pr                           eset: disabled)
   Active: failed (Result: start-limit) since Mon 2021-08-02 01:00:07 UTC; 2h 14                           min ago
  Process: 20254 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, statu                           s=255)
  Process: 20252 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, stat                           us=0/SUCCESS)

Aug 02 01:00:06 smbts-freepbx systemd[1]: Failed to start Fail2Ban Service.
Aug 02 01:00:06 smbts-freepbx systemd[1]: Unit fail2ban.service entered fail....
Aug 02 01:00:06 smbts-freepbx systemd[1]: fail2ban.service failed.
Aug 02 01:00:07 smbts-freepbx systemd[1]: fail2ban.service holdoff time over....
Aug 02 01:00:07 smbts-freepbx systemd[1]: Stopped Fail2Ban Service.
Aug 02 01:00:07 smbts-freepbx systemd[1]: start request repeated too quickly...e
Aug 02 01:00:07 smbts-freepbx systemd[1]: Failed to start Fail2Ban Service.
Aug 02 01:00:07 smbts-freepbx systemd[1]: Unit fail2ban.service entered fail....
Aug 02 01:00:07 smbts-freepbx systemd[1]: fail2ban.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

what do recent logs show when you run journalctl -xe

Here’s the result:

[[email protected] ~]# journalctl -xe
--
-- The result is failed.
Aug 02 12:49:02 smbts-freepbx systemd[1]: Unit fail2ban.service entered failed state.
Aug 02 12:49:02 smbts-freepbx systemd[1]: fail2ban.service failed.
Aug 02 12:49:04 smbts-freepbx crontab[25009]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25011]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25013]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25015]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25017]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25018]: (asterisk) REPLACE (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25020]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25022]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25023]: (asterisk) REPLACE (asterisk)
Aug 02 12:49:04 smbts-freepbx crontab[25025]: (asterisk) LIST (asterisk)
Aug 02 12:49:04 smbts-freepbx systemd[1]: Removed slice User Slice of asterisk.
-- Subject: Unit user-995.slice has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-995.slice has finished shutting down.
Aug 02 12:49:08 smbts-freepbx runuser[25033]: pam_unix(runuser:session): session opened for user asterisk by (uid=0)
Aug 02 12:49:09 smbts-freepbx runuser[25033]: pam_unix(runuser:session): session closed for user asterisk
Aug 02 12:49:09 smbts-freepbx php[2043]: /sbin/ip6tables -w5 -W10000 -F fpbxsvc-api_ssl
Aug 02 12:49:09 smbts-freepbx php[2043]: /sbin/ip6tables -w5 -W10000 -A fpbxsvc-api_ssl -p tcp -m tcp --dport  -j ACCEPT
Aug 02 12:49:09 smbts-freepbx php[2043]: /sbin/iptables -w5 -W10000 -F fpbxsvc-api_ssl
Aug 02 12:49:09 smbts-freepbx php[2043]: /sbin/iptables -w5 -W10000 -A fpbxsvc-api_ssl -p tcp -m tcp --dport  -j ACCEPT

Should have some more entries in the journalctl log with an error somewhere.
I’m wondering if you have the same issue here (Fail2ban wont start).

If you have an error like:
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...

then run this to resolve:
/var/www/html/admin/modules/sysadmin/hooks/fail2ban-apache-config

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