View previous topic :: View next topic |
Author |
Message |
gpreston n00b
Joined: 03 Sep 2003 Posts: 42 Location: West Chester, PA
|
Posted: Thu Jul 01, 2004 4:23 am Post subject: Problem with Postfix and Logrotate |
|
|
Hey everyone,
I've got Postfix 2.0.19 running on a Gentoo server, and it is logging to the default logs (/var/log/mail.err, mail.info, mail.log, and mail.warn). I've got a relatively decent amount of mail traffic going through this server and the logs tend to get rather large over time, so I set up Logrotate 3.6.5-r1 to rotate the logs for me to keep them rather small. I've added the following to my /etc/logrotate.conf file to do the job:
Code: |
/var/log/mail.err /var/log/mail.info /var/log/mail.log /var/log/mail.warn {
rotate 4
size=1M
sharedscripts
postrotate
/etc/init.d/postfix stop > /dev/null
/etc/init.d/postfix start > /dev/null
endscript
}
|
Now, when this runs, for some reason Postfix continues to write to the logfile that was just backed up to a new file, for example /var/log/mail.err.1 and ignores writing to the new empty log file unless I actually reboot the entire server.
I am also using syslog-ng on this server.
Does anyone know what is causing this type of problem? Do you need to look at more logs? |
|
Back to top |
|
|
Rav70 l33t
Joined: 11 Feb 2004 Posts: 607 Location: Poland
|
Posted: Fri Jul 02, 2004 8:17 pm Post subject: Re: Problem with Postfix and Logrotate |
|
|
gpreston wrote: | Hey everyone,
Code: |
/var/log/mail.err /var/log/mail.info /var/log/mail.log /var/log/mail.warn {
rotate 4
size=1M
sharedscripts
postrotate
/etc/init.d/postfix stop > /dev/null
/etc/init.d/postfix start > /dev/null
endscript
}
|
Now, when this runs, for some reason Postfix continues to write to the logfile that was just backed up to a new file, for example /var/log/mail.err.1 and ignores writing to the new empty log file unless I actually reboot the entire server.
I am also using syslog-ng on this server.
|
As it is not postfix but syslog-ng actually writing to the logs you have to reload syslog-ng instead of postfix, like that:
Code: |
/var/log/mail.err /var/log/mail.info /var/log/mail.log /var/log/mail.warn {
rotate 4
size=1M
sharedscripts
postrotate
/etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
endscript
}
|
Regards,
Rav _________________ Q: Why is Microsoft's Product Support a failure?
A: Because Microsoft needs a Support Group instead. |
|
Back to top |
|
|
|
|
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
|
|