Gerhard Hofmann
2006-Feb-09 11:29 UTC
[Dovecot] Dovecot stops logging of imap logins after logrotation
Hi list, on my Debian box there is a logrotation cron job that will gzip existing /var/log/mail.log file and create a new mail.log. It seems that after running logrotation dovecot stops logging successful POP or IMAP logins to /var/log/mail.log (nevertheless, it still works to login with POP or SMTP). This is bad because pop-before-smtp mechanisms also stop working. I have deactivated logrotation cron job and will monitor mail.log file. Maybe I should just run /etc/init.d/dovecot restart after logrotation script. What do you think? TIA Gerhard
Luigi Rosa
2006-Feb-09 11:32 UTC
[Dovecot] Dovecot stops logging of imap logins after logrotation
Gerhard Hofmann wrote:> Maybe I should just run > /etc/init.d/dovecot restart > after logrotation script.Indeed. In alternative you can use syslog to log dovecot activity and let logrotate deal with syslogd restart business. ciao, luigi
Chris Wakelin
2006-Feb-09 11:47 UTC
[Dovecot] Dovecot stops logging of imap logins after logrotation
Gerhard Hofmann wrote:> Maybe I should just run > /etc/init.d/dovecot restart > after logrotation script. >Probably overkill (sorry for the pun!). We just kill -HUP the Dovecot master process :- kill -HUP `cat /var/run/dovecot/master.pid` Best Wishes, Chris -- --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- Christopher Wakelin, c.d.wakelin at reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
Curtis Maloney
2006-Feb-09 22:35 UTC
[Dovecot] Dovecot stops logging of imap logins after logrotation
Gerhard Hofmann wrote:> Hi list, > > on my Debian box there is a logrotation cron job that will gzip existing > /var/log/mail.log file and create a new mail.log. > > It seems that after running logrotation dovecot stops logging successful > POP or IMAP logins to /var/log/mail.log (nevertheless, it still works to > login with POP or SMTP).Most likely Dovecot is still holding onto the file. Sensible log rotation leaves the most recently rotated log uncompressed, in case the daemon is still holding a file descriptor. Most programs (Dovecot included) allow you to send them a signal to tell them to release the log files.> Maybe I should just run > /etc/init.d/dovecot restart > after logrotation script. > > What do you think?I think someone else has already pointed out a SIGHUP should be enough. -- Curtis Maloney cmaloney at cardgate.net