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: mp+82412@code.launchpad.net

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

Description of the change

message:
  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).
modified:
  debian/changelog
  debian/upstart

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

Subscribers

People subscribed via source and target branches

to all changes: