0

OS: Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-101-generic x86_64)

rsyslog not writing logfile mail.log after logrotate, file mail.log is empty.

After restart rsyslog (service rsyslog restart) mail.log starting write.

config logrotate

/var/log/mail.info/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
{
rotate 48
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
    invoke-rc.d rsyslog rotate > /dev/null
endscript
}

I am changed postrotate in config file by this link https://github.com/rsyslog/rsyslog/issues/1506, but it did not help.

1 Answers1

0

The same question was asked and answered in Server Fault: Log files randomly stops writing to log files.

Apparently it's a known bug that can be avoided by changing all occurrences of invoke-rc.d rsyslog rotate to /usr/lib/rsyslog/rsyslog-rotate in /etc/logrotate.d/*.