Anyone having problems with logrotate and CentOS 5.4?
Although I have /etc/logrotate.d/mail (contents below) to rotate my maillog file, it fails to do it automatically:
/var/log/maillog { compress dateext maxage 365 rotate 60 size=+1024k missingok postrotate /etc/init.d/MailScanner restart endscript } ++++++++++++++++++++++++++++
logrotate.conf: ++++++++++++++++++++++++++++++++++++++++++++++++++++ # see "man logrotate" for details # rotate log files weekly #weekly daily
# keep 4 weeks worth of backlogs rotate 5
# create new (empty) log files after rotating old ones create
# uncomment this if you want your log files compressed compress
# RPM packages drop log rotation information into this directory include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here #/var/log/wtmp { # monthly # minsize 1M # create 0664 root utmp # rotate 1 #}
# system-specific logs may be also be configured here. ++++++++++++++++++++++++++++++++++++++++++++++++++++
The file rotates correctly if I manually force it, however my logs won't update until I restart syslogd. In other words, the new /var/log/maillog isn't created after the logrotate. I have to manually restart syslogd and manually touch /var/log/maillog.
I've made no changes to syslog.conf:
/etc/syslog.conf: ++++++++++++++++++++++++++++++++++++++++++++++++++++ # Log all kernel messages to the console. # Logging much else clutters up the screen. #kern.* /dev/console
# Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;authpriv.none;cron.none /var/log/messages
# The authpriv file has restricted access. authpriv.* /var/log/secure
# Log all the mail messages in one place. mail.* -/var/log/maillog
# Log cron stuff cron.* /var/log/cron
# Everybody gets emergency messages *.emerg *
# Save news errors of level crit and higher in a special file. uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log local7.* ++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks!
Ryan Ivey wrote on Mon, 9 Nov 2009 12:47:01 -0500:
The file rotates correctly if I manually force it, however my logs won't update until I restart syslogd. In other words, the new /var/log/maillog isn't created after the logrotate. I have to manually restart syslogd and manually touch /var/log/maillog.
Look in the syslog file for logrotate where the original content for your "recipe" is. There is *no* need to have an extra mail file for logrotate, just get rid of it. Instead change MailScanner logging to a different file and then use something like that. Look at the last line!
/var/log/mailscanner.log { weekly compress dateext maxage 365 rotate 99 size=+4096k notifempty missingok copytruncate }
BTW: your question should have gone to the MailScanner list, anyway.
Kai
Thanks Kai for the input.
There is *no* need to have an extra mail file for logrotate, just get rid
of it.
BTW: your question should have gone to the MailScanner list, anyway.
Well, I can see how that *might* be correct, but take MailScanner out of the equation, it's uses the standard maillog log file. On a stock setup, /var/log/maillog rotates to /var/log/maillog, /var/log/maillog.0, /var/log/maillog.1 and so on. I want to change that to use dateext and compress it, so hence the /etc/logrotate.d/mail file. So if I only wanted to simply rotate the maillog file with those parameters, this would be the appropriate list.
Getting this error, clued me in: error: syslog:1 duplicate log entry for /var/log/maillog
The more appropriate *fix* in this situation is to remove /var/log/mail from /etc/logrotate.d/syslog and allow /var/logrotate.d/mail to handle the rotate. Now all works as desired. I do not remember doing that on my last mailserver setup, but that was sometime ago.
Thanks
On Mon, Nov 9, 2009 at 2:31 PM, Kai Schaetzl maillists@conactive.comwrote:
Ryan Ivey wrote on Mon, 9 Nov 2009 12:47:01 -0500:
The file rotates correctly if I manually force it, however my logs won't update until I restart syslogd. In other words, the new /var/log/maillog isn't created after the logrotate. I have to manually restart syslogd
and
manually touch /var/log/maillog.
Look in the syslog file for logrotate where the original content for your "recipe" is. There is *no* need to have an extra mail file for logrotate, just get rid of it. Instead change MailScanner logging to a different file and then use something like that. Look at the last line!
/var/log/mailscanner.log { weekly compress dateext maxage 365 rotate 99 size=+4096k notifempty missingok copytruncate }
BTW: your question should have gone to the MailScanner list, anyway.
Kai
-- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos