| Summary: | net-analyzer/fail2ban: cannot start on systemd | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Alexey Korepanov <kaikaikai> |
| Component: | Current packages | Assignee: | Gentoo Netmon project <netmon> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kaikaikai, mail, systemd, tatkinson321 |
| Priority: | Normal | Keywords: | PATCH |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | Patch for fail2ban-0.9.4 | ||
|
Description
Alexey Korepanov
2016-04-06 14:43:39 UTC
Another solution I found is to add a line ExecStartPre=/bin/mkdir -p /run/fail2ban to the systemd unit file. Or to add RuntimeDirectory=fail2ban to the systemd unit file. Created attachment 430190 [details, diff]
Patch for fail2ban-0.9.4
This is a really simple patch for fail2ban-0.9.4 that fixes the problem. Patch for 0.9.3 would be different, because systemd unit file is different.
Note that this patch has to be applied *before* /var/run -> /run replacement in the ebuild.
(In reply to Alexey Korepanov from comment #1) Either method would work, though I personally prefer the RuntimeDirectory approach. I am a bit suspicious of RuntimeDirectory, I do not know what systemd does with RuntimeDirectory=fail2ban if the folder /run/fail2ban already exists (is created by tmpfiles.d). So test it? Ok, I tested it. If the directory exists, then it is happily used, and after the service stops it is removed. But I couldn't find this behaviour documented. That is, I don't expect a problem, but using RuntimeDirectory is somewhat less clear than mkdir. Personally I'd be fine with both, but would prefer mkdir :-) (In reply to Alexey Korepanov from comment #6) Oh, we already install a tmpfiles fragment for this. /usr/lib/tmpfiles.d/fail2ban-tmpfiles.conf So you either need to reboot or run the following after installation: systemd-tmpfiles --create fail2ban-tmpfiles.conf A better solution would be to have upstream replace the tmpfiles fragment with the RuntimeDirectory setting. OK, thank you. I didn't notice that tmpfiles.d file is already installed, and I did not reboot for a very long time. I created an issue on fail2ban's github 5 days ago https://github.com/fail2ban/fail2ban/issues/1384 *** Bug 601424 has been marked as a duplicate of this bug. *** This has been fixed in fail2ban-0.10 https://github.com/fail2ban/fail2ban/pull/1618/commits/1cd67ecaa260bdaa6e62383ed783d5910587c258 But 0.10 is not yet stable. When it is stabilized, this bug is resolved. (In reply to Alexey Korepanov from comment #10) > This has been fixed in fail2ban-0.10 |