Bug 78539 - logrotate dies on empty status file
Summary: logrotate dies on empty status file
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: logrotate
Version: 7.2
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elliot Lee
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-25 11:15 UTC by Yan Fitterer
Modified: 2007-04-18 16:48 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2002-11-25 11:15:32 UTC


Attachments (Terms of Use)

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:
Always

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



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