From 5021c3fa71a6d239a8a67303cd564d383a9c6e1d Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 17 Dec 2012 12:26:10 -0500 Subject: tell upstart to reload configuration after writing an upstart job Invoking 'initctl reload-configuration' is only required if inotify does not work. overlayroot does not support inotify. So, we just call initctl always, which wont hurt anything. LP: #1080841 --- cloudinit/handlers/upstart_job.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cloudinit/handlers') diff --git a/cloudinit/handlers/upstart_job.py b/cloudinit/handlers/upstart_job.py index 99e0afde..4e204da0 100644 --- a/cloudinit/handlers/upstart_job.py +++ b/cloudinit/handlers/upstart_job.py @@ -64,3 +64,7 @@ class UpstartJobPartHandler(handlers.Handler): payload = util.dos2unix(payload) path = os.path.join(self.upstart_dir, filename) util.write_file(path, payload, 0644) + + # if inotify support is not present in the root filesystem + # (overlayroot) then we need to tell upstart to re-read /etc + util.subp(["initctl", "reload-configuration"], capture=False) -- cgit v1.2.3 From 6f96b922886c8d607a6be69ae8bc0ce1caf75d04 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 19 Dec 2012 09:21:01 -0500 Subject: cloudinit/handlers/upstart_job.py: pep8 / trailing whitespace --- cloudinit/handlers/upstart_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit/handlers') diff --git a/cloudinit/handlers/upstart_job.py b/cloudinit/handlers/upstart_job.py index 4e204da0..4684f7f2 100644 --- a/cloudinit/handlers/upstart_job.py +++ b/cloudinit/handlers/upstart_job.py @@ -66,5 +66,5 @@ class UpstartJobPartHandler(handlers.Handler): util.write_file(path, payload, 0644) # if inotify support is not present in the root filesystem - # (overlayroot) then we need to tell upstart to re-read /etc + # (overlayroot) then we need to tell upstart to re-read /etc util.subp(["initctl", "reload-configuration"], capture=False) -- cgit v1.2.3 From 6a72a8677ad2e4e66669d2be93880643b0525b51 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 27 Feb 2013 13:02:06 -0500 Subject: do not reload upstart configuration on upstart jobs For now, we disable reloading upstart jobs due to bug 1124384. At some point in the future, we could enable it again when that bug is fixed. The change here allows for a boothook in a multipart input to write the file '/run/cloud-init-upstart-reload' and then have configuration reloaded. --- cloudinit/handlers/upstart_job.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'cloudinit/handlers') diff --git a/cloudinit/handlers/upstart_job.py b/cloudinit/handlers/upstart_job.py index 4684f7f2..0aa7446e 100644 --- a/cloudinit/handlers/upstart_job.py +++ b/cloudinit/handlers/upstart_job.py @@ -65,6 +65,14 @@ class UpstartJobPartHandler(handlers.Handler): path = os.path.join(self.upstart_dir, filename) util.write_file(path, payload, 0644) - # if inotify support is not present in the root filesystem - # (overlayroot) then we need to tell upstart to re-read /etc - util.subp(["initctl", "reload-configuration"], capture=False) + # FIXME LATER (LP: #1124384) + # a bug in upstart means that invoking reload-configuration + # at this stage in boot causes havoc. So, until that is fixed + # we will not do that. However, I'd like to be able to easily + # test to see if this bug is still present in an image with + # a newer upstart. So, a boot hook could easiliy write this file. + if os.path.exists("/run/cloud-init-upstart-reload"): + # if inotify support is not present in the root filesystem + # (overlayroot) then we need to tell upstart to re-read /etc + + util.subp(["initctl", "reload-configuration"], capture=False) -- cgit v1.2.3