Page 1 of 1

CentOS possible problem with fail2ban

Posted: Mon Feb 27, 2017 1:21 pm
by skurudo
CentOS 7.x may have possible problem with fail2ban
when i start vestacp installation on my fresh centos 7 vps in middle of installation when we proceed to installing fail2ban and starting service, fail2ban cannot start and show error:
Job for fail2ban.service failed because the control process exited with error code.
and vestacp installation stops.

Code: Select all

tailf /var/log/messages

Feb 17 19:40:27 localhost systemd: Starting Fail2Ban Service...
Feb 17 19:40:27 localhost fail2ban-client: ERROR  There is no directory /var/run/fail2ban to contain the socket file /var/run/fail2ban/fail2ban.sock.
Feb 17 19:40:27 localhost systemd: fail2ban.service: control process exited, code=exited status=255
Feb 17 19:40:27 localhost systemd: Failed to start Fail2Ban Service.
Feb 17 19:40:27 localhost systemd: Unit fail2ban.service entered failed state.
Feb 17 19:40:27 localhost systemd: fail2ban.service failed.
Feb 17 19:40:27 localhost systemd: fail2ban.service holdoff time over, scheduling restart.
Problem from fail2ban side - https://github.com/fail2ban/fail2ban/issues/1692

Topic on github -> https://github.com/serghey-rodin/vesta/issues/1086

One of quick fix ->

Code: Select all

mkdir -p /var/run/fail2ban

and after installation

Code: Select all

sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/fail2ban/g" /usr/lib/systemd/system/fail2ban.service
systemctl daemon-reload
PS: First found - dpeca, my respects ;-)

PS2: bug in Fail2Ban v0.9.6, on 0.9.5 all right