大网数据广告活动
服务器运维问答

Fail2Ban Not starting when using sudo systemctl status fail2ban.service

· 52CE 我爱测

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 s…

问题原文

原帖链接 · Leon W · CC BY-SA 4.0

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?

已采纳解答

原帖链接 · john · CC BY-SA 4.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-04-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。