View previous topic :: View next topic |
Author |
Message |
eruditas n00b
Joined: 02 Jul 2007 Posts: 52
|
Posted: Mon Sep 13, 2010 12:58 pm Post subject: fail2ban and logrotate |
|
|
Hello. I have a problem. fail2ban restarts every night @ 3:10 and all bans are cleared at this time. Is there any solution for this? I tried to use search but all i could find is this. But its not clear to me, coz lines in my /etc/init.d/fail2ban differs from ones in the link.
Thanks for you arnswers. _________________ Same shit, different asshole |
|
Back to top |
|
|
hpeters n00b
Joined: 26 Sep 2003 Posts: 68
|
Posted: Mon Sep 13, 2010 3:16 pm Post subject: Re: fail2ban and logrotate |
|
|
eruditas wrote: | Hello. I have a problem. fail2ban restarts every night @ 3:10 and all bans are cleared at this time. Is there any solution for this? I tried to use search but all i could find is this. But its not clear to me, coz lines in my /etc/init.d/fail2ban differs from ones in the link.
Thanks for you arnswers. |
Modify /etc/logrotate.d/fail2ban not /etc/init.d/fail2ban
https://bugs.gentoo.org/show_bug.cgi?id=301139
In /etc/logrotate.d/fail2ban change:
The line:
/usr/bin/fail2ban-client reload 1>/dev/null || true
Should be changed to:
/usr/bin/fail2ban-client set logtarget /var/log/fail2ban.log 1>/dev/null || true |
|
Back to top |
|
|
eruditas n00b
Joined: 02 Jul 2007 Posts: 52
|
Posted: Tue Sep 14, 2010 9:14 am Post subject: |
|
|
Thanks I'll see if it works _________________ Same shit, different asshole |
|
Back to top |
|
|
Killerchronic Tux's lil' helper
Joined: 24 Apr 2007 Posts: 91 Location: UK
|
Posted: Tue May 24, 2011 11:36 pm Post subject: |
|
|
I don't feel this is actually worth a new topic as its along the same lines, however why does fail2ban restart every night at 3:10?
I would like to know when it starts and stops but i dont want it restarting every night unless its for good reason. I get multiple emails each night saying it stopped then the same amount saying it started, is there a way to turn off its auto-restart/reload thing, it never used to do this a year or so ago. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23071
|
Posted: Wed May 25, 2011 4:14 am Post subject: |
|
|
The most common cause of early morning restarts is that a logrotate script is trying to move the other program to a new log file. I do not know if this applies to fail2ban, but it is easy to check. |
|
Back to top |
|
|
Killerchronic Tux's lil' helper
Joined: 24 Apr 2007 Posts: 91 Location: UK
|
Posted: Wed May 25, 2011 11:50 pm Post subject: |
|
|
Thanks, i'll look into that, logrotate could be the cause, i dont recall when i installed it on this server but it wasn't during the base install, could well of been around the same time and i never linked the two. |
|
Back to top |
|
|
|