[lxc-devel] LXC Autostart and order...

Serge Hallyn serge.hallyn at ubuntu.com
Wed May 14 13:19:18 UTC 2014


Quoting Michael H. Warfield (mhw at WittsEnd.com):
> This is more directed at Stéphane but other thoughts and comments are
> welcome.
> 
> I'm also looking at the lxc-autostart code and I've noticed a couple of
> things...
> 
> The -g / --groups option is only a single instance option.  Should this
> allow for multiple options?  i.e.  "-g ,onboot -g Mygroup"  Right now,
> it looks like last one wins.

Yes, supporting multiple options is a desired feature, I think Stéphane
had said that if you want to pursue a patch to do that that'd be great.

> That could be handled just by appending multiple instances, separated by
> commas, when processing the command line, even though we later break the
> list apart into a list.
> 
> It looks like the sort ordering is not taking into account group
> membership.  It goes through the list of containers ordered by the
> lxc.start.order parameter and sorts them without regard to what groups
> may have been specified.  That means that "onboot,myboot" is the same as
> "myboot,onboot" and that "WittsEnd-web,WittsEnd-DNS" is the same as
> "WittsEnd-DNS,Wittsend.web".
> 
> So the -g option is then order independent for the specified groups.  Is
> that our desired behavior?  If so, that should be documented or there

I suspect it is, then if you want one group started before the other you
can just call lxc-autostart multiple times.

> may be some undesirable results if dependencies fail.  That gives me
> some heartburn that we may need to document that you need to group your
> orderings to insure that members of one group do not get started before
> members of other groups.  Just doesn't feel like a clean paradigm there.

It could be more flexible than always starting them in the group order.

Although I guess actually I prefer going the other way:  allow containers
to be associated with multiple groups, and only allow one group name to
be specified with lxc-autostart.  Then if you want groups x1 and x2 started
at the same time, you just add all x1 and x2 containers to group y1 as well
and start that group.

That seems simpler to think about, but as I'm not one of the power users
here I'll defer to Stéphane and yourself.

> It's that loop that runs through the containers after the qsort and then
> queries lists_contain_common_entry() that's doing that.  That's where
> adding a catch for the NULL group may be a challenge.  Special case
> where there's a empty string in the group list and no membership in any
> group in the lists_contain_common_entry() would catch that.
> 
> Regards,
> Mike
> -- 
> 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