fail2ban doesn't recreate /var/run/fail2ban directory if destroyed

Bug #234076 reported by Andrew Oakley
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fail2ban (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: fail2ban

Installing fail2ban 0.8.2-2 under Hardy create the directory /var/run/fail2ban/ .

However, if the directory is destroyed, it is not recreated when fail2ban is restarted. As a result, the program cannot create it's .sock and .pid files in the default locations.

This means it cannot run, and when run with /etc/init.d/fail2ban start simply reports "failed" or nothing at all.

/etc/init.d/fail2ban status then says "fail2ban is not running"

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Confirmed. Installing fail2ban shouldn't create /var/run/fail2ban (which is what happens at the moment), but running it should create it instead (baring in mind that /var/run is volatile).

Steps to reproduce:
1) Install fail2ban
2) Stop fail2ban (sudo /etc/init.d/fail2ban stop)
3) Remove /var/run/fail2ban created from install script (sudo rm -r /var/run/fail2ban)
4) Try to restart fail2ban (sudo /etc/init.d/fail2ban start) - observe long pause and fail2ban doesn't start. Confirm that /var/run/fail2ban doesn't exist
5) Re-create /var/run/fail2ban (sudo mkdir /var/run/fail2ban)
6) Re-start fail2ban (sudo /etc/init.d/fail2ban start) - observe service starts correctly now, and presence of *.sock and *.pid file under /var/run/fail2ban

Changed in fail2ban:
status: New → Confirmed
Revision history for this message
Andrew Oakley (andrew-aoakley) wrote :

Chris - are you saying that when you installed fail2ban 0.8.2-2 that it DID create /var/run/fail2ban ?

I'm reasonably sure it didn't for me under any conditions; neither on install nor on run.

I agree that the best place for this directory creation would be at run-time, though, rather than install-time, given the transient nature of /var/run .

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Yes, /var/run/fail2ban gets created at install-time by the current package. The deb package actually contains /var/run/fail2ban as opposed to creating it from one of the install scripts

Revision history for this message
Andrew Oakley (andrew-aoakley) wrote :

[fx: tries installing fail2ban on clean system]

You're right and my original description is wrong. /var/run/fail2ban gets created during install but if subsequently destroyed (as must have happened to me, oops, careless) it is not recreated on runtime. Will change description.

Bug still stands.

(While we're on the subject of fail2ban bugs, could you have a look at bug #234122 and confirm if you agree? Ta.)

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.