After logrotation Dovecot still writes to old log file
Stephen Satchell
list at satchell.net
Fri Jun 15 04:19:05 EEST 2018
>From the manpage:
SIGNALS
Dovecot handles the following signals as described:
USR1 Force dovecot to reopen all configured log files
(log_path, info_log_path and debug_log_path).
So, you need to add
kill -s USR1 `cat /var/run/dovecot/master.pod`
(or wherever your distribution puts the PID for dovecot) in your
log-rotate file, to tell Dovecot to use the new log file.
Alternatively, check to see if "doveadm" is installed in your system; if
not, that would cause exactly the symptoms you are seeing.
On 06/14/2018 03:30 PM, Michael Heuberger wrote:
> Hi there
>
> This is weird. On my latest Ubuntu server Dovecot seems to write to
> /var/log/dovecot.log.1 instead of a recently created /var/log/dovecot.log
>
> Here my logrotate config for Dovecot:
>
> /var/log/dovecot.log {
> su root syslog
> rotate 7
> missingok
> copytruncate
> create 666 root syslog
> sharedscripts
> postrotate
> doveadm log reopen
> endscript
> }
>
> Doveadm should reopen it but no, still writes to old log file.
>
> Not sure, maybe it's someone else, not dovecot, writing to the log file?
>
> And here the versions:
>
> # 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.21 (92477967)
> # OS: Linux 4.14.49-rh65-20180612025235.xenU.x86_64 x86_64 Ubuntu 18.04 LTS
>
> How can we investigate best? Or is there a mistake in the above
> logrotate config?
>
> - Michael
>
More information about the dovecot
mailing list