Merge lp:~jamesodhunt/ubuntu/saucy/sysvinit/force-reload-configuration-for-broken-inotify into lp:ubuntu/saucy/sysvinit

Proposed by James Hunt on 2013-08-17
Status: Needs review
Proposed branch: lp:~jamesodhunt/ubuntu/saucy/sysvinit/force-reload-configuration-for-broken-inotify
Merge into: lp:ubuntu/saucy/sysvinit
Diff against target: 29 lines (+11/-0)
2 files modified
debian/changelog (+7/-0)
debian/src/sysv-rc/sbin/invoke-rc.d (+4/-0)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/saucy/sysvinit/force-reload-configuration-for-broken-inotify
Reviewer Review Type Date Requested Status
Steve Langasek 2013-08-17 Approve on 2013-11-29
Review via email:

Description of the change

* debian/src/sysv-rc/sbin/invoke-rc.d: Call 'initctl reload-configuration'
  to work reliably on systems with broken inotify.

= Note =

The 'reload-configuration' will also be called when invoked from within a chroot.

To post a comment you must log in.
James Hunt (jamesodhunt) wrote :

Although the proposed change is safe for all systems, it is only currently necessary on systems where /etc/init/ is on overlayfs. As such, I wonder if we should be checking to see if /etc/init/ is actually on overlayfs prior to calling 'reload-configuration' (since on my system it took ~1 second to run 'reload-configuration' for the first time).

slangasek/smoser may have an opinion on this.

Martin Pitt (pitti) wrote :

Is that for the live session only? I. e. could we just guard that with

  grep -q '^/cow / overlayfs' /proc/mounts

or something similar?

Martin Pitt (pitti) wrote :

How about making this more generic:

rootfs=$(awk '{if ($5 == "/") print $8; }' /proc/self/mountinfo)

if [ "$rootfs" = "overlayfs" ]; then
   ... do the reload hack


James Hunt (jamesodhunt) wrote :

Not just live session - it's also used by the cloud images I understand.

Steve Langasek (vorlon) wrote :

I'm happy with this change as-is. The worst case is the overhead of unnecessarily rereading all of /etc/init. But that's not hugely expensive, and avoiding that overhead while working around the overlayfs problems would still cost us digging around in /proc. So I think we should stick with the smaller change instead of adding extra guards.

review: Approve

Unmerged revisions

193. By James Hunt on 2013-08-17

debian/src/sysv-rc/sbin/invoke-rc.d: Call 'initctl reload-configuration'
to work reliably on systems with broken inotify.

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 2013-06-04 08:53:47 +0000
3+++ debian/changelog 2013-08-17 12:33:46 +0000
4@@ -1,3 +1,10 @@
5+sysvinit (2.88dsf-41ubuntu4) UNRELEASED; urgency=low
7+ * debian/src/sysv-rc/sbin/invoke-rc.d: Call 'initctl reload-configuration'
8+ to work reliably on systems with broken inotify.
10+ -- James Hunt <> Sat, 17 Aug 2013 13:27:22 +0100
12 sysvinit (2.88dsf-41ubuntu3) saucy; urgency=low
14 * Exit the ondemand script silently if we are on a system that has
16=== modified file 'debian/src/sysv-rc/sbin/invoke-rc.d'
17--- debian/src/sysv-rc/sbin/invoke-rc.d 2013-05-28 19:23:43 +0000
18+++ debian/src/sysv-rc/sbin/invoke-rc.d 2013-08-17 12:33:46 +0000
19@@ -476,6 +476,10 @@
20 fi
22 if [ -n "$is_upstart" ]; then
23+ # Force Upstart to re-scan /etc/init for filesystems with
24+ # broken inotify (such as overlayfs (LP: #882147)).
25+ initctl reload-configuration >/dev/null 2>&1
27 case $saction in
28 status)
29 "$saction" "$INITSCRIPTID" && exit 0


People subscribed via source and target branches

to all changes: