Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 78539

Summary: logrotate dies on empty status file
Product: [Retired] Red Hat Linux Reporter: Yan Fitterer <yan>
Component: logrotateAssignee: Elliot Lee <sopwith>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-11-25 11:15:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Yan Fitterer 2002-11-25 11:15:25 UTC
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 17:20:21 UTC
Can't reproduce with CVS logrotate, I'm assuming it has since been fixed.

Comment 2 Ram Prasad 2004-03-23 09:30:05 UTC
Workaround ? 
This gets solved by deleting logrotate.status and doing a
/usr/sbin/logrotate -f /etc/logrotate.conf