问题原文
原帖链接 · user2224350 · CC BY-SA 3.0
It seems like fail2ban is restarted immediately after calling fail2ban-client stop. Here's a part of the log file
2016-08-29 22:51:42,164 fail2ban.jail [2886]: INFO Jail 'apache-overflows' stopped
2016-08-29 22:51:42,168 fail2ban.server [2886]: INFO Exiting Fail2ban
2016-08-29 22:51:43,300 fail2ban.jail [3235]: INFO Jail 'apache-overflows' started
Also fail2ban-client status returns
Status
|- Number of jail: 11
`- Jail list: apache-auth,...
已采纳解答
原帖链接 · Ryan Babchishin · CC BY-SA 3.0
fail2ban is probably being managed by systemd
On my Ubuntu 16.04 system, the fail2ban service file looks like this:
# /lib/systemd/system/fail2ban.service
[Unit]
Description=Fail2Ban Service
Documentation=man:fail2ban(1)
After=network.target iptables.service firewalld.service
[Service]
Type=forking
ExecStart=/usr/bin/fail2ban-client -x start
ExecStop=/usr/bin/fail2ban-client stop
ExecReload=/usr/bin/fail2ban-client reload
PIDFile=/var/run/fail2ban/fail2ban.pid
Restart=always
[Install]
WantedBy=multi-user.target
According to the documentation Restart=always means this:
If set to always, the service will be restarted regardless of whether it exited cleanly or not, got terminated abnormally by a signal, or hit a timeout.
So you're fail2ban service is automatically restarting when you stop it.
If you want to stop it you'll need to use systemctl
systemctl stop fail2ban
You can start it again with
systemctl start fail2ban
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
