Debian: Logrotate Fehler

Fehler:

/etc/cron.daily/logrotate:

gzip: stdin: file size changed while zipping

Fix:

http://stackoverflow.com/questions/31155418/how-can-i-fix-etc-cron-daily-logrotate-gzip-stdin-file-size-changed-while-z

In English, you can read this bug report.

To summarise:

  1. First you have to add the --verbose option in the script /etc/cron.daily/logrotate to have more information the next time it runs to identify which rotation log cause the problem.#!/bin/sh

    test -x /usr/sbin/logrotate || exit 0
    /usr/sbin/logrotate –verbose /etc/logrotate.conf`

  2. Next you have to add the delaycompress option in logrotate configuration.

Anmerkung/Beispiel:

Nachdem –verbose hinzugefügt wurde konnte der Verursache Munin identifiziert werden:

renaming /var/log/munin/munin-update.log to /var/log/munin/munin-update.log.1

creating new /var/log/munin/munin-update.log mode = 0640 uid = 110 gid = 4

compressing log with: /bin/gzip

gzip: stdin: file size changed while zipping

 

In /etc/logrotate.d/munin setzen wir jetzt nun die delaycompress option:

/var/log/munin/munin-update.log {

        daily

        missingok

        rotate 7

        compress

        notifempty

        create 640 munin adm

        delaycompress

}