Dovecot logrotation - old journal files are still in use

Aki Tuomi aki.tuomi at open-xchange.com
Mon Mar 18 09:08:58 EET 2019


Are you sure the 'reopen' command is really executed? It might want full
path to the command there.

Aki

On 14.3.2019 8.44, Denis V Razumovskiy via dovecot wrote:
> Hi all
>  
> Cannot understand, does it a bug or just a misconfiguration. In my
> Dovecot there are 3 files of logging (debug, info and .log)
> While executing logrotation, the new files are created, but old ones,
> namely dovecot.*.1 are still in use by the process
>  
> I use next logrotate config for dovecot:
> /var/log/dovecot.log /var/log/dovecot.info /var/log/dovecot.debug {
>   daily
>   rotate 14
>   missingok
>   notifempty
>   compress
>   delaycompress
>   sharedscripts
>   postrotate
>     doveadm log reopen
>     chmod 666 /var/log/dovecot.log
>     chmod 666 /var/log/dovecot.info
>     chmod 666 /var/log/dovecot.debug
>   endscript
> }
>
> Here is the logger process in memory:
> root 19140 0.0 0.0 4140 1576 ? S Mar12 0:06 dovecot/log
>  
> Here the files it uses after the daily logrotation:
> # lsof -p19140 |grep log
> ...
> log     19140 root   33w   REG        9,3      811  417675
> /var/log/dovecot.log.1
> log     19140 root   34w   REG        9,3  2842123  417681
> /var/log/dovecot.info.1
> log     19140 root   35w   REG        9,3 14853918  417683
> /var/log/dovecot.debug.1
> ...
>
> On manually issuing 'doveadm log reopen`  used files are changed to
> # lsof -p19140 |grep dovecot\\\.
> ...
> log     19140 root   33w   REG        9,3       0  417651
> /var/log/dovecot.log
> log     19140 root   34w   REG        9,3  121374  417690
> /var/log/dovecot.info
> log     19140 root   35w   REG        9,3  916153  417691
> /var/log/dovecot.debug
>  
> as it is expected to be
> What can be the root of the issue?
>  
> I use Dovecot as LDA for Postfix with system users, mbox mail format.
> System Slackware 12.0 x86, Postfix 2.4.5, Dovecot 2.2.36. Interconnect
> Postfix-Dovecot was made via mailbox_command
> Dovecot compiled from sources
>  
> Logging configuration (file conf.d/10-logging.conf) contains the
> following:
>
> log_path = /var/log/dovecot.log
> info_log_path = /var/log/dovecot.info
> debug_log_path = /var/log/dovecot.debug
>
> auth_verbose = yes
> auth_verbose_passwords = yes
> auth_debug = yes
> mail_debug = yes
> verbose_ssl = yes
>
> plugin {
> }
>
> Could the fact, that Postfix require Dovecot logs to be accessible
> someway, result in such a weird behavior? To allow other processes to
> access Dovecot logs I had to chmod 0666 all the current logs while
> integrating Dovecot into Postfix delivery (please see `chmod' commands
> in the logrotate config above)
>  
>  
>  
> Thank you
> Denis Razoumovskiy
>  
>  
>  


More information about the dovecot mailing list