fail2ban 自启动后会导致 firewalld 无法自启动.
1 | systemctl restart firewalld.service |
会遇到如下报错
1 | Failed to restart firewalld.service: Transaction contains conflicting jobs 'restart' and 'stop' for fail2ban.service. Probably contradicting requirement |
可以通过如下步骤重启
方法一:
1 2 3 | systemctl stop fail2ban.service systemctl restart firewalld.service systemctl start fail2ban.service |
方法二:
1 2 | systemctl stop firewalld.service systemctl start firewalld.service |
最后通过如下方法让其开机自启动
1 | chmod +x /etc/rc.d/rc.local //让其可执行 |
1 | vi /etc/rc.d/rc.local |
最后面加入
1 | systemctl stop fail2ban.service && systemctl restart firewalld.service && systemctl restart fail2ban.service |