Dovecot logrotation - old journal files are still in use (second attempt)

Denis V Razumovskiy d_razumovskiy at futureservice.ru
Fri Mar 15 09:03:07 EET 2019


Hi all

Sorry, it is the second attempt due to wrong format of the first message.
 
In my Dovecot there are 3 files of logging (debug, info and .log) While executing logrotation, the new files are created, but the previos ones, namely dovecot.*.1 are still in use by the process

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 had happened:
# 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
...

After the manual issue 'doveadm log reopen` command the 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.
 
I use the logrotate config for dovecot instance:
/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
}

At the same time, dovecot itself still uses previous logs:

# lsof |grep var\/log\/dovecot\.
dovecot   19138       root    8w      REG        9,3     12962     417613 /var/log/dovecot.log.1 (deleted)
dovecot   19138       root    9w      REG        9,3   4097250     416836 /var/log/dovecot.info.1 (deleted)
dovecot   19138       root   10w      REG        9,3  23816347     417603 /var/log/dovecot.debug.1 (deleted)



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 has been made via `mailbox_command = ...'
Dovecot was 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)
 

Please ignore my previos post https://dovecot.org/pipermail/dovecot/2019-March/115075.html
 
Thank you
Denis Razoumovskiy


More information about the dovecot mailing list