[lxc-devel] LXC Autostart and order...
Michael H. Warfield
mhw at WittsEnd.com
Thu May 15 20:19:40 UTC 2014
On Thu, 2014-05-15 at 22:07 +0200, Stéphane Graber wrote:
> On Thu, May 15, 2014 at 03:58:10PM -0400, Michael H. Warfield wrote:
> > On Wed, 2014-05-14 at 13:19 +0000, Serge Hallyn wrote:
> > > 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 patch is now ready. I'll be submitting it before too long.
> >
> > In light of the fact that the other autostart patches from Dwight and I
> > have not been acked or pushed and that this patch affects those patches
> > (obviates the need to call lxc-autostart twice), I'll role them up into
> > a larger patch.
> Sounds good, thanks!
> I'm back to work tomorrow (until Tuesday) so I'm planning on doing a bit
> of catching up on those patches and push whatever's left to push.
Only gotcha I think you might zing me on is on coding style.
lxc-autostart already had a lot of lines longer that 80 characters (8
char tab stops) and I had to indent the main loop another tab stop for
the group loop. :-P Don't know how strict you want to be on that. I
did comment as much as I thought appropriate. :-)=)
> > > > 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!
-------------- 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/20140515/3b74048f/attachment-0001.sig>
More information about the lxc-devel
mailing list