#788805 fail2ban: systemd repeatedly restarts fail2ban when fail2ban takes a long time to start

#788805#5
Date:
2015-06-15 08:42:41 UTC
From:
To:
Dear Maintainer,

I have the following in my jail.local to re-ban things which were
banned in the last 10 days on startup:

bantime  = -1
findtime = 864000

This makes fail2ban take quite a long time to start as it re-scrapes
the logs.

Because of this long start-up, systemd thinks fail2ban failed to start
and tries to restart it.  This results in many fail2ban processes.

I had to add the following to
/etc/systemd/system/multi-user.target.wants/fail2ban.service:

TimeoutStartSec=900

For systems with small log files this may not be necessary but
tracking this down took some time.  It is worthwhile adding this to
the fail2ban.service and maybe adding a comment to jail.conf