Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fail2ban and logrotate
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
eruditas
n00b
n00b


Joined: 02 Jul 2007
Posts: 52

PostPosted: Mon Sep 13, 2010 12:58 pm    Post subject: fail2ban and logrotate Reply with quote

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
View user's profile Send private message
hpeters
n00b
n00b


Joined: 26 Sep 2003
Posts: 68

PostPosted: Mon Sep 13, 2010 3:16 pm    Post subject: Re: fail2ban and logrotate Reply with quote

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
View user's profile Send private message
eruditas
n00b
n00b


Joined: 02 Jul 2007
Posts: 52

PostPosted: Tue Sep 14, 2010 9:14 am    Post subject: Reply with quote

Thanks :) I'll see if it works :)
_________________
Same shit, different asshole
Back to top
View user's profile Send private message
Killerchronic
Tux's lil' helper
Tux's lil' helper


Joined: 24 Apr 2007
Posts: 91
Location: UK

PostPosted: Tue May 24, 2011 11:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23071

PostPosted: Wed May 25, 2011 4:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Killerchronic
Tux's lil' helper
Tux's lil' helper


Joined: 24 Apr 2007
Posts: 91
Location: UK

PostPosted: Wed May 25, 2011 11:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum