RE
Ce que j’ai fait :
ExecStop=/usr/bin/fail2ban-client stop
ExecReload=/usr/bin/fail2ban-client reload
PIDFile=/var/run/fail2ban/fail2ban.pid
Restart=on-failure
RestartPreventExitStatus=0 255
Et dans
Il faut s’assurer que la valeur est la même que dans le fichier /etc/fail2ban/fail2ban.conf
:
pidfile = /var/run/fail2ban/fail2ban.pid
Sinon, je continue :
root@cloud-ciuvr1n7:~# systemctl status fail2ban
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-07-27 14:29:22 CEST; 51min ago
Docs: man:fail2ban(1)
Process: 57247 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, status=0/SUCCESS)
Process: 57248 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)
Main PID: 57248 (code=exited, status=255/EXCEPTION)
juil. 27 14:29:22 cloud-ciuvr1n7 systemd[1]: Starting Fail2Ban Service...
juil. 27 14:29:22 cloud-ciuvr1n7 systemd[1]: Started Fail2Ban Service.
juil. 27 14:29:22 cloud-ciuvr1n7 fail2ban-server[57248]: Failed during configuration: File contains no section headers.
juil. 27 14:29:22 cloud-ciuvr1n7 fail2ban-server[57248]: file: '/etc/fail2ban/jail.d/1nf02m4c0253845714.conf', line: 2
juil. 27 14:29:22 cloud-ciuvr1n7 fail2ban-server[57248]: '<VirtualHost *:80>\n'
juil. 27 14:29:22 cloud-ciuvr1n7 fail2ban-server[57248]: Async configuration of server failed
juil. 27 14:29:22 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
juil. 27 14:29:22 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Et :
root@cloud-ciuvr1n7:~# journalctl -u fail2ban
-- Logs begin at Mon 2021-06-28 11:43:08 CEST, end at Tue 2021-07-27 15:17:01 CEST. --
juin 28 15:01:05 cloud-ciuvr1n7 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/ru
juin 28 15:01:05 cloud-ciuvr1n7 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/ru
juin 28 15:01:05 cloud-ciuvr1n7 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/ru
juin 28 15:01:05 cloud-ciuvr1n7 systemd[1]: Starting Fail2Ban Service...
juin 28 15:01:05 cloud-ciuvr1n7 systemd[1]: Started Fail2Ban Service.
juin 28 15:01:06 cloud-ciuvr1n7 fail2ban-server[38767]: Server ready
juin 28 15:01:06 cloud-ciuvr1n7 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/ru
juil. 27 14:22:25 cloud-ciuvr1n7 systemd[1]: Stopping Fail2Ban Service...
juil. 27 14:22:26 cloud-ciuvr1n7 fail2ban-client[57191]: Shutdown successful
juil. 27 14:22:26 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Main process exited, code=killed, status=15/TERM
juil. 27 14:22:26 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Succeeded.
juil. 27 14:22:26 cloud-ciuvr1n7 systemd[1]: Stopped Fail2Ban Service.
juil. 27 14:22:26 cloud-ciuvr1n7 systemd[1]: Starting Fail2Ban Service...
juil. 27 14:22:26 cloud-ciuvr1n7 systemd[1]: Started Fail2Ban Service.
juil. 27 14:22:26 cloud-ciuvr1n7 fail2ban-server[57199]: Failed during configuration: File contains no section headers.
juil. 27 14:22:26 cloud-ciuvr1n7 fail2ban-server[57199]: file: '/etc/fail2ban/jail.d/1nf02m4c0253845714.conf', line: 2
juil. 27 14:22:26 cloud-ciuvr1n7 fail2ban-server[57199]: '<VirtualHost *:80>\n'
juil. 27 14:22:26 cloud-ciuvr1n7 fail2ban-server[57199]: Async configuration of server failed
juil. 27 14:22:26 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
juil. 27 14:22:26 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
juil. 27 14:23:12 cloud-ciuvr1n7 systemd[1]: Starting Fail2Ban Service...
juil. 27 14:23:12 cloud-ciuvr1n7 systemd[1]: Started Fail2Ban Service.
juil. 27 14:23:12 cloud-ciuvr1n7 fail2ban-server[57205]: Failed during configuration: File contains no section headers.
juil. 27 14:23:12 cloud-ciuvr1n7 fail2ban-server[57205]: file: '/etc/fail2ban/jail.d/1nf02m4c0253845714.conf', line: 2
juil. 27 14:23:12 cloud-ciuvr1n7 fail2ban-server[57205]: '<VirtualHost *:80>\n'
juil. 27 14:23:12 cloud-ciuvr1n7 fail2ban-server[57205]: Async configuration of server failed
juil. 27 14:23:12 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
juil. 27 14:23:12 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
juil. 27 14:24:08 cloud-ciuvr1n7 systemd[1]: Starting Fail2Ban Service...
juil. 27 14:24:08 cloud-ciuvr1n7 systemd[1]: Started Fail2Ban Service.
juil. 27 14:24:08 cloud-ciuvr1n7 fail2ban-server[57213]: Failed during configuration: File contains no section headers.
juil. 27 14:24:08 cloud-ciuvr1n7 fail2ban-server[57213]: file: '/etc/fail2ban/jail.d/1nf02m4c0253845714.conf', line: 2
juil. 27 14:24:08 cloud-ciuvr1n7 fail2ban-server[57213]: '<VirtualHost *:80>\n'
juil. 27 14:24:08 cloud-ciuvr1n7 fail2ban-server[57213]: Async configuration of server failed
juil. 27 14:24:08 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
juil. 27 14:24:08 cloud-ciuvr1n7 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
juil. 27 14:29:22 cloud-ciuvr1n7 systemd[1]: Starting Fail2Ban Service...
juil. 27 14:29:22 cloud-ciuvr1n7 systemd[1]: Started Fail2Ban Service.
juil. 27 14:29:22 cloud-ciuvr1n7 fail2ban-server[57248]: Failed during configuration: File contains no section headers.
juil. 27 14:29:22 cloud-ciuvr1n7 fail2ban-server[57248]: file: '/etc/fail2ban/jail.d/1nf02m4c0253845714.conf', line: 2
juil. 27 14:29:22 cloud-ciuvr1n7 fail2ban-server[57248]: '<VirtualHost *:80>\n'
lines 1-42