为什么auth.log每天轮换多次?

我注意到我的auth.log有可疑的行为。 出于某种原因,每次旋转时都会旋转多次。

2014-06-15 06:25:06,102 fail2ban.filter : INFO Log rotation detected for /var/log/auth.log 2014-06-15 06:25:06,102 fail2ban.filter : INFO Log rotation detected for /var/log/auth.log 2014-06-15 06:25:20,117 fail2ban.filter : INFO Log rotation detected for /var/log/auth.log 2014-06-15 06:25:20,117 fail2ban.filter : INFO Log rotation detected for /var/log/auth.log 

/etc/logrotate.d/ syslog-ng

 /var/log/auth.log { rotate 4 weekly missingok notifempty compress delaycompress sharedscripts postrotate invoke-rc.d syslog-ng reload > /dev/null endscript } 

我检查了旧的日志,发现这在几个月前就开始了。
那里出了什么问题?

  1. 在debugging中运行logrotate,也许在强制模式下检查什么configuration和多less次旋转。 也许几个logrotateconfiguration尝试旋转auth.log。
  2. 然后检查你的cron日志,logrotate被调用了多less次。 也许一些cronconfiguration是重复的,几次调用logrotate。

这是因为在fa​​il2ban中有多个filter,监视不同的failregex组合的同一个日志…例如你的apache,badbots和wordpressfilter…

find你的监狱文件,并运行以下命令:grep“/ var / log / auth”jail.local

或类似的东西,它应该显示你三个实例。