You are not logged in.

#1 2011-12-19 14:40:32

maddog39
Member
From: Philadelphia, PA
Registered: 2007-06-03
Posts: 73
Website

fail2ban fails to start after update and reboot

Hello everyone,

I installed updates on my server today and decided it was time for a reboot. After the server came back up, I noticed fail2ban never started and attempted to start it manually. It fails to start via /etc/rc.d/fail2ban start every single time. I tried to start via /usr/bin/fail2ban-client start but that also fails and returns the error

$ sudo fail2ban-client start
WARNING 'action' not defined in 'php-url-fopen'. Using default value
WARNING 'action' not defined in 'lighttpd-fastcgi'. Using default value
2011-12-19 09:35:35,993 fail2ban.server : INFO   Starting Fail2ban v0.8.4
2011-12-19 09:35:35,993 fail2ban.server : INFO   Starting in daemon mode
ERROR  Could not start server. Maybe an old socket file is still present. Try to remove /var/run/fail2ban/fail2ban.sock. If you used fail2ban-client to start the server, adding the -x option will do it
$ rm /var/run/fail2ban/fail2ban.sock
rm: cannot remove `/var/run/fail2ban/fail2ban.sock': No such file or directory
$ ls /var/run
crond.pid  daemons  dhcpcd  dhcpcd-eth0.pid  lighttpd  lock  mount  mysqld  ntpd  openvpn  sshd.pid  syslog-ng.ctl  syslog-ng.pid  udev  utmp
$ ls /var/run/daemons/
crond  iptables  lighttpd  mysqld  netfs  network  ntpd  openvpn  sshd  syslog-ng
$ sudo fail2ban-client -x start
WARNING 'action' not defined in 'php-url-fopen'. Using default value
WARNING 'action' not defined in 'lighttpd-fastcgi'. Using default value
2011-12-19 09:37:36,542 fail2ban.server : INFO   Starting Fail2ban v0.8.4
2011-12-19 09:37:36,542 fail2ban.server : INFO   Starting in daemon mode
ERROR  Could not start server. Maybe an old socket file is still present. Try to remove /var/run/fail2ban/fail2ban.sock. If you used fail2ban-client to start the server, adding the -x option will do it

As you can see, the sock file does not exist, yet it still fails to start with no indication as to why. Using the -x option to force start, also fails. Does anyone have any ideas as to why f2b is failing to start.

Thanks
Alec

Offline

#2 2011-12-20 04:19:56

Ztjuh
Member
Registered: 2011-05-30
Posts: 58

Re: fail2ban fails to start after update and reboot

I have the same problem. Fail2ban won't start in any way.

[ztjuh@ztjuh rc.d]$ ./fail2ban start
:: Starting fail2ban                                                                                                                                                                                                                                      [FAIL]
[ztjuh@ztjuh rc.d]$ sudo fail2ban-client start
2011-12-20 07:08:17,596 fail2ban.server : INFO   Starting Fail2ban v0.8.4
2011-12-20 07:08:17,597 fail2ban.server : INFO   Starting in daemon mode
ERROR  Could not start server. Maybe an old socket file is still present. Try to remove /var/run/fail2ban/fail2ban.sock. If you used fail2ban-client to start the server, adding the -x option will do it
[ztjuh@ztjuh rc.d]$ sudo fail2ban-client -x start
2011-12-20 07:10:58,311 fail2ban.server : INFO   Starting Fail2ban v0.8.4
2011-12-20 07:10:58,312 fail2ban.server : INFO   Starting in daemon mode
ERROR  Could not start server. Maybe an old socket file is still present. Try to remove /var/run/fail2ban/fail2ban.sock. If you used fail2ban-client to start the server, adding the -x option will do it

Also there is no directory /var/run/fail2ban/ for me, or a fail2ban.sock in /var/run/. Should I make the fail2ban directory as root?

Thanks,
Alex

Last edited by Ztjuh (2011-12-20 04:20:22)

Offline

#3 2011-12-20 04:23:04

Ztjuh
Member
Registered: 2011-05-30
Posts: 58

Re: fail2ban fails to start after update and reboot

Ok lol, fixed, I made the fail2ban directory as root, and it starts smile

Offline

#4 2011-12-20 04:47:15

Ztjuh
Member
Registered: 2011-05-30
Posts: 58

Re: fail2ban fails to start after update and reboot

After a reboot, fail2ban didn't start again.

/var/run/fail2ban/ wasn't there again, after creating the directory as root, it succeeds to start.

Offline

#5 2011-12-20 18:22:54

maddog39
Member
From: Philadelphia, PA
Registered: 2007-06-03
Posts: 73
Website

Re: fail2ban fails to start after update and reboot

Ztjuh wrote:

After a reboot, fail2ban didn't start again.

/var/run/fail2ban/ wasn't there again, after creating the directory as root, it succeeds to start.

Hmm interesting. Well I don't know about you but I think its time to file a bug report, no?

[Edit]
Perhaps a temporary fix would be to add 'mkdir -p /var/run/fail2ban' to your /etc/rc.local file?

Last edited by maddog39 (2011-12-20 18:24:13)

Offline

#6 2011-12-21 00:30:10

nzeh
Member
Registered: 2011-12-20
Posts: 3

Re: fail2ban fails to start after update and reboot

It seems to me that this is related to the latest initscripts update.  Initscripts seems to be doing some cleanup of /var/run, while fail2ban thinks that, once it has setup /var/run/fail2ban during installation, the directory will always be there.  The "proper" fix for this is to create a file fail2ban.conf (name not important) in /etc/tmpfiles.d with contents:

D /run/fail2ban 0755 root root -

This creates the directory /run/fail2ban with permissions 0755, user root, and group root at startup.  Since /var/run is only a symlink to /run, this fixes the problem.

[EDIT]

I think a bug report against fail2ban is in order.  Its package should simply create the above file to ensure /var/run/fail2ban is recreated upon every restart.

Last edited by nzeh (2011-12-21 00:32:42)

Offline

#7 2011-12-21 18:42:30

maddog39
Member
From: Philadelphia, PA
Registered: 2007-06-03
Posts: 73
Website

Re: fail2ban fails to start after update and reboot

Seems bug has already been filed and an updated pacakge is already in testing.

https://bugs.archlinux.org/task/22926?p … g=fail2ban

[edit]
This bug was filed in Feb '11 and is still open?? But it was working until recently, lol.

Last edited by maddog39 (2011-12-21 18:44:30)

Offline

#8 2011-12-31 14:45:35

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: fail2ban fails to start after update and reboot

The package is in [community] already. Please test it to see if the bug is fixed.

Offline

#9 2013-04-03 01:36:49

liuexp
Member
Registered: 2011-05-10
Posts: 6

Re: fail2ban fails to start after update and reboot

It seems the package in community didn't fix the problem

Offline

#10 2013-04-04 12:36:25

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: fail2ban fails to start after update and reboot

liuexp, please start a new thread if you are serious about getting a solution. Please do not necro-bump. Closing.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB