Merge lp:~jamesodhunt/ubuntu/trusty/upstart/periodic-logrotate into lp:ubuntu/trusty/upstart

Proposed by James Hunt on 2014-01-21
Status: Needs review
Proposed branch: lp:~jamesodhunt/ubuntu/trusty/upstart/periodic-logrotate
Merge into: lp:ubuntu/trusty/upstart
Diff against target: 34 lines (+17/-1)
2 files modified
debian/changelog (+3/-1)
debian/user-conf/periodic-logrotate.conf (+14/-0)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/trusty/upstart/periodic-logrotate
Reviewer Review Type Date Requested Status
Steve Langasek 2014-01-21 Pending
Review via email: mp+202434@code.launchpad.net

Description of the Change

We already provide a logrotate session job which runs soon after the user session has been created. However, it is never re-run.

It seems sensible that, like its /etc/cron.daily/logrotate system counterpart we run this job periodically to keep session jobs logs compacted. This would help with for example bug 1269838 (although may admittedly mask the issue to some degree). By creating this new job to handle the periodicity, it is easy for a user to modify the period:

    # change period to 5 minutes
    echo 'env ROTATE_SECONDS=300' >> ~/.config/upstart/periodic-logrotate.override

We could encapsulate all this within the logrotate job itself but 2 jobs allows the existing behaviour to be retained should that be desirable by simply disabling the new job:

   echo manual >> ~/.config/upstart/periodic-logrotate.override

To post a comment you must log in.

Unmerged revisions

1538. By James Hunt on 2014-01-21

debian/user-conf/periodic-logrotate.conf: Session job to run logrotate
hourly by default.

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 2014-01-15 16:53:28 +0000
3+++ debian/changelog 2014-01-21 11:11:36 +0000
4@@ -11,8 +11,10 @@
5 - Added all inline events to SEE ALSO section for quick reference.
6 (when coupled with latest upstream doc changes, closes: bug#732128).
7 * debian/control: add Build-Depends on libtool for test_conf_preload.sh.
8+ * debian/user-conf/periodic-logrotate.conf: Session job to run logrotate
9+ hourly by default.
10
11- -- James Hunt <james.hunt@ubuntu.com> Wed, 15 Jan 2014 16:52:05 +0000
12+ -- James Hunt <james.hunt@ubuntu.com> Tue, 21 Jan 2014 11:01:36 +0000
13
14 upstart (1.10-2) unstable; urgency=low
15
16
17=== added file 'debian/user-conf/periodic-logrotate.conf'
18--- debian/user-conf/periodic-logrotate.conf 1970-01-01 00:00:00 +0000
19+++ debian/user-conf/periodic-logrotate.conf 2014-01-21 11:11:36 +0000
20@@ -0,0 +1,14 @@
21+# periodic-logrotate - rotate logs regularly.
22+
23+# rotate every hour by default
24+env ROTATE_SECONDS=3600
25+
26+start on startup
27+
28+script
29+ while :
30+ do
31+ sleep "$ROTATE_SECONDS"
32+ start logrotate >/dev/null 2>&1 || :
33+ done
34+end script

Subscribers

People subscribed via source and target branches

to all changes: