I am running since today fail2ban on ubuntu 22.04 with ipv6 and when i start ubuntu the logs says every time i booting:
2023-04-21 23:43:39,740 fail2ban.server [1662]: INFO
Shutdown in progress... 2023-04-21 23:43:39,741 fail2ban.observer
[1662]: INFO Observer stop ... try to end queue 5 seconds
2023-04-21 23:43:39,762 fail2ban.observer [1662]: INFO
Observer stopped, 0 events remaining. 2023-04-21 23:43:39,803
fail2ban.server [1662]: INFO Stopping all jails 2023-04-21
23:43:39,804 fail2ban.filter [1662]: INFO Removed logfile:
'/var/log/auth.log' 2023-04-21 23:43:40,026 fail2ban.actions
[1662]: NOTICE [sshd] Flush ticket(s) with iptables-multiport
2023-04-21 23:43:41,007 fail2ban.jail [1662]: INFO Jail
'sshd' stopped 2023-04-21 23:43:41,008 fail2ban.database [1662]:
INFO Connection to database closed. 2023-04-21 23:43:41,009
fail2ban.server [1662]: INFO Exiting Fail2ban
I need to run the command sudo service fail2ban restart
and then the fail2ban service is running as expected. What i am doing wrong?
The service seems to be killed
$ sudo systemctl status fail2ban.service
○ fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:fail2ban(1)
I have also tried to update the /lib/systemd/system/fail2ban.service
and set the Restart option to always:
[Unit]
Description=Fail2Ban Service
Documentation=man:fail2ban(1)
After=network.target iptables.service firewalld.service ip6tables.service ipset.service nftables.service
PartOf=firewalld.service
[Service]
Type=simple
Environment="PYTHONNOUSERSITE=1"
ExecStart=/usr/bin/fail2ban-server -xf start
ExecStop=/usr/bin/fail2ban-client stop
ExecReload=/usr/bin/fail2ban-client reload
RuntimeDirectory=fail2ban
PIDFile=/run/fail2ban/fail2ban.pid
Restart=always
RestartPreventExitStatus=0 255
Environment="PYTHONNOUSERSITE=yes"
[Install]
WantedBy=multi-user.target