[lxc-devel] lxc-stop inconsistencies

Robert Vogelgesang vogel at users.sourceforge.net
Thu Jan 30 15:32:52 UTC 2014


Hi Serge,

On Thu, Jan 30, 2014 at 12:19:53PM +0000, Serge Hallyn wrote:
> Quoting Robert Vogelgesang (vogel at users.sourceforge.net):
> > Hi,
> > 
> > during my tests today I found some inconsistencies between the documented
> > and the actual behaviour of some lxc-stop options.
> > 
> > The documentation says that you could use --nokill to prevent hard-killing
> > the container's processes; actually you have to use --no-kill, or else
> > lxc-stop will complain.  Looking at the source, the same seems to be
> > true for --nolock; you'd have to use --no-lock instead.
> > 
> > And --nowait / -W works as documented only when used together with --reboot,
> > but using
> > 
> > # lxc-stop -n test -W
> > 
> > waits until the container has shut down.
> > 
> > What should be fixed, documentation or lxc-stop's behaviour?
> 
> I think the code should be fixed.

OK, I just sent a patch that changes lxc-stop to use --nokill and --nolock
instead of --no-kill and --no-lock.

For --nowait to work as documented in the shutdown case, the fix is not
so simple.  lxc-stop calls the API shutdown function - lxcapi_shutdown()
in lxccontainer.c - in in this case, but this function does not support
any form of "nowait".

Either we have to change lxcapi_shutdown(), or we have to invent some
new (API ?) function for lxc-stop, that just sends the configured
haltsignal to the container.  Or am I overlooking some already existing
function that could be used for this?

	Robert

> 
> thanks,
> -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