Merge lp:~kim0/logrotate/bug-730504 into lp:ubuntu/natty/logrotate

Proposed by Ahmed Kamal on 2011-03-12
Status: Merged
Merged at revision: 16
Proposed branch: lp:~kim0/logrotate/bug-730504
Merge into: lp:ubuntu/natty/logrotate
Diff against target: 32 lines (+16/-0)
2 files modified
debian/changelog (+7/-0)
debian/cron.daily (+9/-0)
To merge this branch: bzr merge lp:~kim0/logrotate/bug-730504
Reviewer Review Type Date Requested Status
Dave Walker Approve on 2011-03-12
Ubuntu branches 2011-03-12 Pending
Review via email: mp+53127@code.launchpad.net

Description of the change

Patch to allow for cleaning up non-existent files from logrotate status file.
An accident had caused one million logfiles to be created on my machine, and that was causing logrotate to use 100% cpu for long times. Apparently upstream logrotate does not offer any facility to do that

To post a comment you must log in.
lp:~kim0/logrotate/bug-730504 updated on 2011-03-12
17. By Ahmed Kamal on 2011-03-12

sed stripping quotes from filenames, overwriting status.clean

Dave Walker (davewalker) wrote :

Thanks for making them fixes. With this, approved and uploading. Submitting to Debian.

Good catch!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-07-14 19:34:54 +0000
3+++ debian/changelog 2011-03-12 20:22:14 +0000
4@@ -1,3 +1,10 @@
5+logrotate (3.7.8-6ubuntu2) natty; urgency=low
6+
7+ * cron.daily: Added ability to clean non existent log files from
8+ logrotate status file (LP: #730504)
9+
10+ -- Ahmed Kamal <kim0@ubuntu.com> Sat, 12 Mar 2011 14:58:38 +0200
11+
12 logrotate (3.7.8-6ubuntu1) maverick; urgency=low
13
14 * Merge from debian unstable (LP: #554823), remaining changes:
15
16=== modified file 'debian/cron.daily'
17--- debian/cron.daily 2004-06-11 13:51:34 +0000
18+++ debian/cron.daily 2011-03-12 20:22:14 +0000
19@@ -1,4 +1,13 @@
20 #!/bin/sh
21
22+# Clean non existent log file entries from status file
23+cd /var/lib/logrotate
24+head -1 status > status.clean
25+while read logfile date
26+do
27+ [ -e "$logfile" ] && echo "\"$logfile\" $date"
28+done < < <(sed 's/"//g' status) >> status.clean
29+mv status.clean status
30+
31 test -x /usr/sbin/logrotate || exit 0
32 /usr/sbin/logrotate /etc/logrotate.conf

Subscribers

People subscribed via source and target branches

to all changes: