Denis V Razumovskiy
2019-Mar-14 06:44 UTC
Dovecot logrotation - old journal files are still in use
<div xmlns="http://www.w3.org/1999/xhtml">Hi all</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">Cannot understand, does it a bug or just a misconfiguration. In my Dovecot there are 3 files of logging (debug, info and .log)</div><div xmlns="http://www.w3.org/1999/xhtml">While executing logrotation, the new files are created, but old ones, namely dovecot.*.1 are still in use by the process</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">I use next logrotate config for dovecot:</div><div xmlns="http://www.w3.org/1999/xhtml">/var/log/dovecot.log /var/log/dovecot.info /var/log/dovecot.debug {<br /> daily<br /> rotate 14<br /> missingok<br /> notifempty<br /> compress<br /> delaycompress<br /> sharedscripts<br /> postrotate<br /> doveadm log reopen<br /> chmod 666 /var/log/dovecot.log<br /> chmod 666 /var/log/dovecot.info<br /> chmod 666 /var/log/dovecot.debug<br /> endscript<br />}<br /><br />Here is the logger process in memory:</div><div xmlns="http://www.w3.org/1999/xhtml">root 19140 0.0 0.0 4140 1576 ? S Mar12 0:06 dovecot/log</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">Here the files it uses after the daily logrotation:</div><div xmlns="http://www.w3.org/1999/xhtml"># lsof -p19140 |grep log</div><div xmlns="http://www.w3.org/1999/xhtml">...</div><div xmlns="http://www.w3.org/1999/xhtml">log 19140 root 33w REG 9,3 811 417675 /var/log/dovecot.log.1<br />log 19140 root 34w REG 9,3 2842123 417681 /var/log/dovecot.info.1<br />log 19140 root 35w REG 9,3 14853918 417683 /var/log/dovecot.debug.1<br />...</div><div xmlns="http://www.w3.org/1999/xhtml"><br />On manually issuing 'doveadm log reopen` used files are changed to</div><div xmlns="http://www.w3.org/1999/xhtml"># lsof -p19140 |grep dovecot\\\.<br />...<br />log 19140 root 33w REG 9,3 0 417651 /var/log/dovecot.log<br />log 19140 root 34w REG 9,3 121374 417690 /var/log/dovecot.info<br />log 19140 root 35w REG 9,3 916153 417691 /var/log/dovecot.debug</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">as it is expected to be</div><div xmlns="http://www.w3.org/1999/xhtml">What can be the root of the issue?</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">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</div><div xmlns="http://www.w3.org/1999/xhtml">Dovecot compiled from sources</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">Logging configuration (file conf.d/10-logging.conf) contains the following:<br /><br />log_path = /var/log/dovecot.log<br />info_log_path = /var/log/dovecot.info<br />debug_log_path = /var/log/dovecot.debug<br /><br />auth_verbose = yes<br />auth_verbose_passwords = yes<br />auth_debug = yes<br />mail_debug = yes<br />verbose_ssl = yes<br /><br />plugin {<br />}<br /><br />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)</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">Thank you</div><div xmlns="http://www.w3.org/1999/xhtml">Denis Razoumovskiy</div><div> <div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml"> </div></div>
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 > ? > ? > ?
Denis V Razumovskiy
2019-Mar-19 06:26 UTC
Dovecot logrotation - old journal files are still in use
Hi Aki was right, full path to doveadm binary solve the issue. Now logs are renewed. Thank you very much Thanks to all for your time Denis 14.03.2019, 09:44, "Denis V Razumovskiy" <d_razumovskiy at futureservice.ru>:> 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? ?????????, ????? ???????????
Maybe Matching Threads
- Dovecot logrotation - old journal files are still in use (second attempt)
- Dovecot stops logging of imap logins after logrotation
- logrotation
- Selecting from matrix and then stacking in array.
- Free Ruby and Rails screencasts from CodeGear -- Live Virtual Developer Conference Mar12-16