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

Michael H. Warfield mhw at WittsEnd.com
Tue May 13 15:56:05 UTC 2014


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.

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
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'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!

-------------- 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/20140513/431b1461/attachment.sig>


More information about the lxc-devel mailing list