Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 529268

Summary: net-analyzer/fail2ban systemd service needs to create /run/fail2ban
Product: Gentoo Linux Reporter: Craig Andrews <candrews>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal CC: candrews
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Craig Andrews gentoo-dev 2014-11-14 20:21:16 UTC
The systemd service installed by net-analyzer/fail2ban (as of 0.9.1) fails with this error, taken from journalctl:
---
Nov 14 15:15:00 irrational systemd[1]: Unit fail2ban.service entered failed state.
Nov 14 15:15:00 irrational systemd[1]: fail2ban.service failed.
Nov 14 15:15:01 irrational fail2ban-client[27910]: ERROR  There is no directory /run/fail2ban to contain the socket file /run/fail2ban/fail2ban.sock.
Nov 14 15:15:01 irrational systemd[1]: fail2ban.service: control process exited, code=exited status=255
Nov 14 15:15:01 irrational systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Unit fail2ban.service has failed
---

/usr/lib/systemd/system/fail2ban.service needs these 2 lines added:
ExecStartPre=/bin/mkdir -p /run/fail2ban
ExecStopPost=/bin/rm -fR /run/fail2ban

With that change, it works great.

Reproducible: Always
Comment 1 Craig Andrews gentoo-dev 2014-11-14 20:31:05 UTC
Nevermind - unless you reboot, you must run "systemd-tmpfiles --create" to apply /usr/lib/tmpfiles.d/fail2ban-tmpfiles.conf which creates this directory.