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

Kees Bos cornelis.bos at gmail.com
Thu Oct 5 10:08:10 UTC 2017


On do, 2017-10-05 at 10:27 +0200, Christian Brauner wrote:
> 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

I think that's least problematic approach :-)

On second thoughts, if we do support both ways, I don't think it should
be a setting in the container config but something that's system wide
(since it's dependent on the installed lxd and not on the container).


More information about the lxc-users mailing list