[lxc-devel] [PATCH] Add a non-null group for autobooting

Serge Hallyn serge.hallyn at ubuntu.com
Fri May 2 21:03:19 UTC 2014


Quoting Michael H. Warfield (mhw at WittsEnd.com):
> On Thu, 2014-05-01 at 17:26 -0400, Michael H. Warfield wrote:
> > Looks good to me with the provisio that I feel that autoboot on bootup
> > should be for all groups and not just the null group.  Dwight told me in
> > another message that he did it that way because the Upstart script did
> > it that way.  Was it an oversight or was it a decision?  That can be a
> > separate patch to fix.
> 
> I haven't seen Dwight's patch go in and I haven't seen any other
> commentary about it or my suggested change.  His patch fixes a reported
> problem and my change supports allowing containers which are members of
> designated groups to boot (which I require).  Therefore, I'm submitting
> this patch.  Both "boot" and "autoboot" were suggested for names of the
> autoboot group.  I choose to use "onboot" just to make it a little
> clearer and disambiguate it from some of the other options.
> 
> This patch is dependent on Dwight's patch Subject:
> [PATCH v2] have systemd service call lxc-autostart via script
> 
> Regards,
> Mike
> 
> -- 
> Add a non-null group for autobooting
> 
> This adds a non-null group (onboot) to the sysvinit startup script
> for autobooting containers.  This allows for containers which are
> in other groups to be included in the autoboot process.
> 
> This script is used by both the sysvinit systems and the systemd
> systems.
> 
> Signed-off-by: Michael H. Warfield <mhw at WittsEnd.com>

While this is the right place to do it, I don't think we should encourage
differences among init systems...  So we should either do it in upstart
as well, or not do it at all imo.  Otherwise admins will become very
confused.

> ---
>  config/init/sysvinit/lxc.in | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/config/init/sysvinit/lxc.in b/config/init/sysvinit/lxc.in
> index b1a725c..0b802af 100644
> --- a/config/init/sysvinit/lxc.in
> +++ b/config/init/sysvinit/lxc.in
> @@ -64,6 +64,9 @@ case "$1" in
>  
>  	# Start containers
>  	wait_for_bridge
> +	# Start autoboot containers first.
> +	action $"Starting LXC onboot containers: " /usr/bin/lxc-autostart -g onboot
> +	# Start NULL group containers last.
>  	action $"Starting LXC containers: " "$bindir"/lxc-autostart
>  	touch "$localstatedir"/lock/subsys/lxc
>  	;;
> -- 
> 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!
> 



> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel



More information about the lxc-devel mailing list