Hi,
I want to create a new log /var/log/maillog for postfix each day and so i created a new logrotate config for the log and removed it from /etc/logrotate.d/syslog.
~]# cat /etc/logrotate.d/maillog /var/log/maillog { daily rotate 31 start 1 compress create 0600 root postrotate /etc/init.d/postfix reload > /dev/null endscript }
After /var/log/maillog has rotated, postfix doesn't log anything to the new log file till i restart syslog. It doesn't matter if i reload or restart postfix. Is this a normal behaviour with this log file and if yes why?
Thomas
On Fri, Sep 21, 2007 at 01:06:06PM +0200, Thomas Antony wrote:
After /var/log/maillog has rotated, postfix doesn't log anything to the new log file till i restart syslog. It doesn't matter if i reload or restart postfix.
You don't need to restart syslog, merely send it a SIGHUP
Is this a normal behaviour with this log file and if yes why?
Yes.
Postfix doesn't write to the file directly, it sends its messages to syslog which writes according to the mail.* entries in syslog.conf
Check the existing syslog logrotate entry.
Stephen Harris schrieb:
On Fri, Sep 21, 2007 at 01:06:06PM +0200, Thomas Antony wrote:
After /var/log/maillog has rotated, postfix doesn't log anything to the new log file till i restart syslog. It doesn't matter if i reload or restart postfix.
You don't need to restart syslog, merely send it a SIGHUP
Is this a normal behaviour with this log file and if yes why?
Yes.
Postfix doesn't write to the file directly, it sends its messages to syslog which writes according to the mail.* entries in syslog.conf
Check the existing syslog logrotate entry.
Thank you!
Thomas