Red Hat Bugzilla – Bug 78539
logrotate dies on empty status file
Last modified: 2007-04-18 12:48:41 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Linux 2.4.9-31smp i686) Opera 6.1 [en]
Description of problem:
logrotate dies when the status file /var/lib/logrotate.status is empty ( 0 bytes)
Error message is:
error: error reading top line of /var/lib/logrotate.status
command exits with $? = 1
This situation should not normally arise, but somehow, logrotate created itself an empty file - so the parser should be able to deal with it.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. rm /var/lib/logrotate.status (if exists)
2. touch /var/lib/logrotate.status
3. /usr/sbin/logrotate /etc/logrotate.conf
Actual Results: error: error reading top line of /var/lib/logrotate.status
Expected Results: Actual log rotation
Begs the question: Why did the empty file get created in the first place?
Can't reproduce with CVS logrotate, I'm assuming it has since been fixed.
This gets solved by deleting logrotate.status and doing a
/usr/sbin/logrotate -f /etc/logrotate.conf