Problem: Logrotate Emails About Errors During Compression

Problem

You are getting emails regarding an issue while compressing logfiles like the following:

> ---------- Ursprüngliche Nachricht ----------
> Von: root@ucs.multi.ucs
> An: root@ucs.multi.ucs
> Datum: 16. Dezember 2018 um 06:25
> Betreff: Cron <root@ucs> test -x /usr/sbin/anacron || ( cd / && run-parts
> --report /etc/cron.daily )
>
> /etc/cron.daily/logrotate:
> error: Compressing program wrote following message to stderr when compressing log
> /var/log/univention/listener.log.1:
> gzip: stdin: file size changed while zipping

Root Cause

The univention-directory-listener might hang (at least partially) and thus does not react to the default “term” signal. So the process continues to write to the rotated logfile resulting in an error from gzip.

Solution

Send the “kill” Signal to the process to force the termination:
killall -9 /usr/sbin/univention-directory-listener

The service should restart automatically.

Mastodon