Apache-2.2

Fail2Ban 使用 sudo systemctl status fail2ban.service 時未啟動

  • April 3, 2019

當我嘗試使用sudo service fail2ban restart它重新啟動fail2ban時,會顯示以下錯誤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.

然後當我執行它時,顯示此錯誤,表明 fail2ban 未以 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.

但是,如果我使用該命令,sudo fail2ban-client start則 Fail2Ban 正常啟動,沒有錯誤。有沒有人知道為什麼服務不能與 Fail2Ban 一起使用,因為我相信它也會阻止它在啟動時啟動?

對不起,我想把它作為評論而不是回答,但我沒有太多的聲譽,所以我建議你在你的 jail.local 文件中為一個不存在的服務啟用了一個監獄,所以去那個 /etc/fail2ban /jail.local 並蒐索您啟用的內容並刪除啟用的單詞和句子然後“sudo systemctl restart fail2ban”並檢查“sudo systemctl status fail2ban”

和它的工作原理!或者我希望什麼,告訴我它是否有效,我可能會進一步幫助你

引用自:https://serverfault.com/questions/961338