Merge lp:~jamesodhunt/ubuntu/precise/procps/fix-for-bug-771372 into lp:ubuntu/precise/procps

Proposed by James Hunt
Status: Merged
Merge reported by: Steve Langasek
Merged at revision: not available
Proposed branch: lp:~jamesodhunt/ubuntu/precise/procps/fix-for-bug-771372
Merge into: lp:ubuntu/precise/procps
Diff against target: 31 lines (+12/-1)
2 files modified
debian/changelog (+9/-0)
debian/upstart (+3/-1)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/precise/procps/fix-for-bug-771372
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Ubuntu branches Pending
Review via email:

This proposal supersedes a proposal from 2011-11-11.

Description of the change

  Make procps job run twice: as early as possible (for kernel
  parameters such as kernel.printk) and then afteer all network
  interfaces are up (to account for any kernel parameters relating
  to recently loaded networking modules) (LP: #771372).

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote : Posted in a previous version of this proposal

There are a couple of race conditions here that have me hesitant to merge this particular implementation because I'm worried it isn't going to do the job.

The first race condition is that sysctl might take a long time to complete, so the first 'start on virtual-filesystems' job could still be running at the time 'started networking' is emitted, causing the job to only be run once. I think this is an unlikely race condition for us to hit in practice, so it doesn't really worry me, given that everyone acknowledges that this script is still very kludgy.

The second race condition, however, is one that I know we hit in practice: /etc/init/networking.conf may trigger before all of the network devices are actually available. If we miss *this* race with one of the devices we're attempting to apply sysctl settings to, we're in trouble.

James, what do you think about either changing this to be 'start on [...] or static-network-up', or changing it to be 'start on [...] or net-device-up' with an 'instance' rule?

review: Needs Fixing
Revision history for this message
James Hunt (jamesodhunt) wrote : Posted in a previous version of this proposal

Hi Steve,

Yes, I was certainly aware of the races, but unclear on the size of the window for problems. Also, the "start on" as originally submitted was incorrect: I think what I was aiming for was "start on virtual-filesystems or stopped networking" (essentially equivalent to "start on virtual-filesystems or static-network-up"). However, that reads strangely and clearly my fingers thought so too and 'corrected' my thoughts! :-)

What I've now proposed is:

  instance $UPSTART_EVENTS
  start on virtual-filesystems or static-network-up

This should now be "safe" in the sense that 2 instance of the job can now co-exist. My only concern is what happens if multiple instance of the sysctl *binary* were to be running at the same time; sysctl uses buffered writes, which are not guaranteed to be atomic. If we hit problems, maybe we could tweak sysctl to use write(2).

Revision history for this message
St├ęphane Graber (stgraber) wrote :

James, has this been merged? I seem to remember seeing something similar to that (if not identical) go on precise-changes and as a SRU.

Revision history for this message
Steve Langasek (vorlon) wrote :

Yes, this was merged then I failed to push to lp before uploading. So it's pseudo-merged.

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 2011-10-27 16:58:44 +0000
3+++ debian/changelog 2011-11-16 15:31:16 +0000
4@@ -1,3 +1,12 @@
5+procps (1:3.2.8-11ubuntu2) precise; urgency=low
7+ * Make procps job run twice: as early as possible (for kernel
8+ parameters such as kernel.printk) and then after all network
9+ interfaces are up (to account for any kernel parameters relating
10+ to recently loaded networking modules) (LP: #771372).
12+ -- James Hunt <> Wed, 16 Nov 2011 15:17:38 +0000
14 procps (1:3.2.8-11ubuntu1) precise; urgency=low
16 * Merge from Debian testing, remaining changes:
18=== modified file 'debian/upstart'
19--- debian/upstart 2010-06-09 10:18:14 +0000
20+++ debian/upstart 2011-11-16 15:31:16 +0000
21@@ -5,7 +5,9 @@
23 description "set sysctls from /etc/sysctl.conf"
25-start on virtual-filesystems
26+instance $UPSTART_EVENTS
28+start on virtual-filesystems or static-network-up
30 task
31 script


People subscribed via source and target branches

to all changes: