Fail2Ban – Not Starting When Using sudo systemctl status fail2ban.service

apache-2.2centosfail2bansudosystemctl

When i try and restart fail2ban using sudo service fail2ban restart it displays the following error from systemctl status fail2ban.service

Apr 02 20:12:30 centos systemd[1]: fail2ban.service: control process exited, code=exited status=255
    Apr 02 20:12:30 centos systemd[1]: Failed to start Fail2Ban Service.
    Apr 02 20:12:30 centos systemd[1]: Unit fail2ban.service entered failed state.
    Apr 02 20:12:30 centos systemd[1]: fail2ban.service failed.
    Apr 02 20:12:30 centos systemd[1]: fail2ban.service holdoff time over, scheduling restart.
    Apr 02 20:12:30 centos systemd[1]: Stopped Fail2Ban Service.
    Apr 02 20:12:30 centos systemd[1]: start request repeated too quickly for fail2ban.service
    Apr 02 20:12:30 centos systemd[1]: Failed to start Fail2Ban Service.
    Apr 02 20:12:30 centos systemd[1]: Unit fail2ban.service entered failed state.
    Apr 02 20:12:30 centos systemd[1]: fail2ban.service failed.

then when i run
it, displays this error sugesting that fail2ban is not starting as sudo

Apr 02 20:12:30 centos fail2ban-client[3623]: ERROR  No file(s) found for glob /var/www/example.com/log/error.log
    Apr 02 20:12:30 centos fail2ban-client[3623]: ERROR  Failed during configuration: Have not found any log file for apache jail
    Apr 02 20:12:30 centos systemd[1]: fail2ban.service: control process exited, code=exited status=255
    Apr 02 20:12:30 centos systemd[1]: Failed to start Fail2Ban Service.

However, if i use the command sudo fail2ban-client start then Fail2Ban Starts normally with no errors.
Does anyone have any idea as to why service is not working with Fail2Ban because i believe its also stopping it from starting at boot?

Best Answer

sorry i would like to give it as a comment not answer but i don't have much reputation, so i suggest you have enabled a jail for a non-existed service on your jail.local file, so go to that /etc/fail2ban/jail.local and search for what you've enabled and delete the enabled word and sentence then "sudo systemctl restart fail2ban" and check "sudo systemctl status fail2ban"

and vola it works! or that what i hope, tell me if it worked, i might help you further