[lxc-devel] [PATCH] Enhance Upstart init script to autoboot the "onboot" group.

Michael H. Warfield mhw at WittsEnd.com
Fri May 2 21:33:43 UTC 2014


At Serge's suggestion, I'm submitting a patch to update the Upstart
files to support autobooting the "onboot" group corresponding to the
patch I submitted earlier for the sysvinit script used by SysV init and
Systemd.

Provisos...

I have no way to test these changes as I have no Upstart running host.

I have no way to know if this it the optimum solution for the Upstart
case.

Someone else needs to test this change.

I managed to screw up a patch a day or so ago because I didn't double
test the changes after I had copied them from my development directory
back to my head git directory.  Consequently, given I can't even test
this once, this comes with no warranty.

Patch:

-- 
Enhance Upstart init script to autoboot the "onboot" group.

Add the feature to the Upstart init script to boot the "onboot"
group dependent on the start.auto = 1 flag.  This brings the
the Upstart behavior into congruence with the sysvinit script
for SysV Init and Systemd.
 
Signed-off-by: Michael H. Warfield <mhw at WittsEnd.com>
---
 config/init/upstart/lxc.conf | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/config/init/upstart/lxc.conf b/config/init/upstart/lxc.conf
index d5131ad..3578a37 100644
--- a/config/init/upstart/lxc.conf
+++ b/config/init/upstart/lxc.conf
@@ -20,6 +20,13 @@ pre-start script
 
 	[ "x$LXC_AUTO" = "xtrue" ] || exit 0
 
+	# Process the "onboot" group first.
+	lxc-autostart -L -g onboot | while read line; do
+		set -- $line
+		(start lxc-instance NAME=$1 && sleep $2) || true
+	done
+
+	# Now process the <NULL> group.
 	lxc-autostart -L | while read line; do
 		set -- $line
 		(start lxc-instance NAME=$1 && sleep $2) || true
-- 
1.9.0


-- 
Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140502/1095cbef/attachment.sig>


More information about the lxc-devel mailing list