Adicionar delaycompress
à seção de configuração para /var/log/
resolverá o problema.
De man logrotate
:
delaycompress
Postpone compression of the previous log file to the next rota‐
tion cycle. This only has effect when used in combination with
compress. It can be used when some program cannot be told to
close its logfile and thus might continue writing to the previ‐
ous log file for some time.
Curiosamente, a configuração original que eu tinha (sem a diretiva delaycompress
) veio diretamente de man logrotate
(exceto que eu mudei weekly
para daily
):
# sample logrotate configuration file
compress
/var/log/messages {
rotate 5
weekly
postrotate
/usr/bin/killall -HUP syslogd
endscript
}