systemd service update:

- starting service in normal mode (without forking)
- does not restart if service exited normally (exit-code 0, e.g. stopped via fail2ban-client)
- does not restart if service can not start (exit-code 255, e.g. wrong configuration, etc.)
- service can be additionally started/stopped with commands (fail2ban-client, fail2ban-server)
pull/1618/head
sebres 2016-11-22 11:14:27 +01:00
parent 261f875748
commit 528a7a5abb
1 changed files with 4 additions and 3 deletions

View File

@ -5,12 +5,13 @@ After=network.target iptables.service firewalld.service
PartOf=iptables.service firewalld.service
[Service]
Type=forking
ExecStart=/usr/bin/fail2ban-client -x start
Type=simple
ExecStart=/usr/bin/fail2ban-server -xf start
ExecStop=/usr/bin/fail2ban-client stop
ExecReload=/usr/bin/fail2ban-client reload
PIDFile=/var/run/fail2ban/fail2ban.pid
Restart=always
Restart=on-failure
RestartPreventExitStatus=0 255
[Install]
WantedBy=multi-user.target