Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 78539 - logrotate dies on empty status file
logrotate dies on empty status file
Product: Red Hat Linux
Classification: Retired
Component: logrotate (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
Depends On:
  Show dependency treegraph
Reported: 2002-11-25 06:15 EST by Yan Fitterer
Modified: 2007-04-18 12:48 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-11-25 06:15:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Yan Fitterer 2002-11-25 06:15:25 EST
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):

How reproducible:

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

Additional info:

Begs the question: Why did the empty file get created in the first place?
Comment 1 Elliot Lee 2002-12-10 12:20:21 EST
Can't reproduce with CVS logrotate, I'm assuming it has since been fixed.
Comment 2 Ram Prasad 2004-03-23 04:30:05 EST
Workaround ? 
This gets solved by deleting logrotate.status and doing a
/usr/sbin/logrotate -f /etc/logrotate.conf

Note You need to log in before you can comment on or make changes to this bug.