[lxc-devel] [lxc-users] Container startup hook arguments

Christian Brauner christian.brauner at mailbox.org
Thu Oct 5 08:27:45 UTC 2017


On Wed, Oct 04, 2017 at 09:35:25AM -0500, Serge Hallyn wrote:
> Quoting Kees Bos (cornelis.bos at gmail.com):
> > I'm not using it, but do expect the extra args:
> > 
> > while [ {{ '${#@}' }} -gt 3 ] ; do
> >    ...
> >    shift
> > done
> > 
> > It might be that some users will need the last extra argument (stage:
> > pre-start|start|post-stop). This is currently not available in the
> > environment.
> > 
> > I can live without these extra arguments, but will have to update my
> > scripts.
> 
> Ok, but this will hurt then.  I certainly was going to keep the
> extra args, but they would be shifted now.  We can pass along an
> environment variable saying something like LXC_SIMPLE_ARGS=1 or
> something, but your unmodified script won't know to look for
> that so will do the wrong thing.  Any ideas?
> 
> This unfortunately basically means that you are in fact a "user",
> and that makes this seem like at best 3.0  material then, unless
> we can find a good solution.
> 
> Maybe a configuration key 'lxc.hooks.version=2' ?

I'm fine with simply keeping the arguments until 3.0 and then removing them. I
really don't want to add configuration keys that conceptually are internal keys
but are nonetheless exposed to users. Fwiw, this is also why I didn't implement
a version key for the 2.1. config file format update. This is just going to bite
us in the long run when we have to deprecate these internal keys. TL;DR, keep
the args for now and kill them in 3.0.

Christian

> 
> Thanks for replying!
> 
> -serge
> _______________________________________________
> 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