Fail2ban 启动时出错

Fail2ban 启动时出错

最近,我尝试重新启动Fail2ban,但收到了错误,导致无法启动......我收到的完整错误systemctl status fail2ban如下:

Jan 03 18:27:02 nerdofcode.com systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Jan 03 18:27:02 nerdofcode.com systemd[1]: Failed to start Fail2Ban Service.
Jan 03 18:27:02 nerdofcode.com systemd[1]: fail2ban.service: Unit entered failed state.
Jan 03 18:27:02 nerdofcode.com systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Jan 03 18:27:02 nerdofcode.com systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Jan 03 18:27:02 nerdofcode.com systemd[1]: Stopped Fail2Ban Service.
Jan 03 18:27:02 nerdofcode.com systemd[1]: fail2ban.service: Start request repeated too quickly.
Jan 03 18:27:02 nerdofcode.com systemd[1]: Failed to start Fail2Ban Service.
Jan 03 18:27:02 nerdofcode.com systemd[1]: fail2ban.service: Unit entered failed state.
Jan 03 18:27:02 nerdofcode.com systemd[1]: fail2ban.service: Failed with result 'exit-code'.

的完整输出cat /var/log/fail2ban.log为:

2018-01-03 18:06:28,337 fail2ban.server         [25119]: INFO    
Exiting Fail2ban

我将非常感激针对此问题的任何建议或解决方案。

答案1

错误很可能已被记录下来,/var/log/fail2ban.log但是您也可以通过运行查看问题所在fail2ban-client -x start,并获得一些描述性信息。

就我的情况来说,这是一个尚不存在的进出口拒绝日志。

感谢@bistoco 对该问题的评论。

答案2

错误未按/var/log/fail2ban.log其他地方的建议登录。您最好提前停止该fail2ban过程。然后systemd执行以下操作:

sudo /usr/bin/fail2ban-client stop

就我的情况而言,它甚至没有运行,所以在那之后我手动启动它fail2ban,最后它给了我错误:

$ sudo /usr/bin/fail2ban-client stop
RROR  Failed to access socket path: /var/run/fail2ban/fail2ban.sock. Is fail2ban running?
$ sudo /usr/bin/fail2ban-client -x start
ERROR  No file(s) found for glob /var/log/apache2/*error.log
ERROR  Failed during configuration: Have not found any log file for apache-shellshock jail

我继续修正了apache-shellshock说明/etc/fail2ban/jail.local并重新启动fail2ban,它就起作用了。

相关内容