100% CPU due to non-existent entries in logrotate.status

Bug #730504 reported by Ahmed Kamal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: logrotate

I'm seeing logrotate use 100% CPU for a couple of minutes daily!

I've tracked this issue to "logrotate.status" being ~57MB, having one million lines, almost all of them mentioning log files that are now non-existent (I had an accident where millions of files were created once). I believe the correct behavior is for logrotate to "clean" its status file removing lines that reference non existent files. If logrotate itself doesn't do that, can we have a cronjob to do it be default.

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package logrotate - 3.7.8-6ubuntu2

---------------
logrotate (3.7.8-6ubuntu2) natty; urgency=low

  * cron.daily: Added ability to clean non existent log files from
    logrotate status file (LP: #730504)
 -- Ahmed Kamal <email address hidden> Sat, 12 Mar 2011 14:58:38 +0200

Changed in logrotate (Ubuntu):
status: New → Fix Released
Revision history for this message
Loïc Minier (lool) wrote :

This broke cron.daily:

/etc/cron.daily/logrotate:
/etc/cron.daily/logrotate: 9: Syntax error: redirection unexpected
run-parts: /etc/cron.daily/logrotate exited with return code 2

This construct:
while read logfile date
do
    [ -e "$logfile" ] && echo "\"$logfile\" $date"
done < < <(sed 's/"//g' status) >> status.clean

has weird < < <()

I guess the idea was:
sed 's/"//g' status | while read logfile date
do
    [ -e "$logfile" ] && echo "\"$logfile\" $date"
done >> status.clean

Revision history for this message
Ahmed Kamal (kim0) wrote :

@Loïc a fix was quickly pushed to fix that, thanks for reporting it

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.