fail2ban.service: use RuntimeDirectory instead of hardcoding /run

Also, remove PIDFile option, it's not needed for a Type=simple process run in foreground.
pull/3515/head
Etienne Doms 2023-05-22 19:32:15 +02:00 committed by GitHub
parent 5d9603c104
commit 890049c78a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -7,13 +7,12 @@ PartOf=iptables.service firewalld.service ip6tables.service ipset.service nftabl
[Service]
Type=simple
Environment="PYTHONNOUSERSITE=1"
ExecStartPre=/bin/mkdir -p /run/fail2ban
ExecStart=@BINDIR@/fail2ban-server -xf start
# if should be logged in systemd journal, use following line or set logtarget to sysout in fail2ban.local
# ExecStart=@BINDIR@/fail2ban-server -xf --logtarget=sysout start
ExecStop=@BINDIR@/fail2ban-client stop
ExecReload=@BINDIR@/fail2ban-client reload
PIDFile=/run/fail2ban/fail2ban.pid
RuntimeDirectory=fail2ban
Restart=on-failure
RestartPreventExitStatus=0 255