Mart Pirita
2007-Apr-19 17:28 UTC
[Dovecot] Maillog rotates, but dovecot still writes logs into old logfile?
Tere. I use: log_path = /var/log/maillog info_log_path = /var/log/maillog And into /var/log are: maillog maillog.1 maillog.2 maillog.3 Now when log files are rotating at 04:00 (maillog > maillog.1) dovecot still keeps login into maillog.1 and not into maillog, where sendmail, etc writes logs. The only solution I did found, is adding into /etc/logrotate.d/syslog command to restart dovecot: /var/log/maillog { postrotate /usr/bin/killall -HUP syslogd /etc/rc.d/init.d/dovecot restart >/dev/null 2>&1 endscript } Any other solution? -- Mart
Troy Engel
2007-Apr-19 17:41 UTC
[Dovecot] Maillog rotates, but dovecot still writes logs into old logfile?
Mart Pirita wrote:> > The only solution I did found, is adding into /etc/logrotate.d/syslog > command to restart dovecot: > > /etc/rc.d/init.d/dovecot restart >/dev/null > 2>&1As per the wiki, dovecot listens to SIGUSR1 to reopen a log. You want to simply use a command like: /bin/kill -USR1 `cat /var/run/dovecot/master.pid 2>/dev/null` 2> /dev/null || true See here: http://wiki.dovecot.org/Logging#head-8886f6e09e2f691a4c45448f18f914c124dead50 -te -- Troy Engel | Systems Engineer Fluid, Inc | http://www.fluid.com
Eric Rostetter
2007-Apr-19 17:43 UTC
[Dovecot] Maillog rotates, but dovecot still writes logs into old logfile?
Quoting Mart Pirita <sysadmin at e-positive.ee>:> log_path = /var/log/maillog > info_log_path = /var/log/maillogCould be dangerous, unless all programs writing to /var/log/maillog use append mode (and it is on local disks, etc).> Now when log files are rotating at 04:00 (maillog > maillog.1) dovecot > still keeps login into maillog.1 and not into maillog, where sendmail, > etc writes logs.Yes, sounds right.> The only solution I did found, is adding into /etc/logrotate.d/syslog > command to restart dovecot: > > /var/log/maillog { > postrotate > > /usr/bin/killall -HUP syslogd > > /etc/rc.d/init.d/dovecot restart >/dev/null 2>&1 > endscript > > } > > > Any other solution?Have dovecot log via syslog instead of to a file, and the problem goes away.> -- > Mart-- Eric Rostetter The Department of Physics The University of Texas at Austin Go Longhorns!
Mart Pirita
2007-Apr-19 21:17 UTC
[Dovecot] Maillog rotates, but dovecot still writes logs into old logfile?
Tere.> > Have dovecot log via syslog instead of to a file, and the problem goes > away. >Prr, how did I miss this? So, uncommenting all: #log_path = /var/log/maillog #info_log_path = /var/log/maillog #syslog_facility = mail should do the trick and log all via syslog to /var/log/maillog? -- Mart