[Lxc-users] Best way to shutdown a container

Денис Ризаев kernelmadness at nine9.ru
Fri Aug 13 14:47:06 UTC 2010


2010/8/13 Daniel Lezcano <daniel.lezcano at free.fr>

> On 08/13/2010 03:55 PM, Clemens Perz wrote:
> > Hi!
> >
> > I used to run lxc-stop on my system containers when I actually want to
> > run a halt. Only today I noticed, that stop actually kills all
> > processes, not really doing a halt. I went through the lxc commands and
> > did not find something graceful to do this job from the host systems
> > shutdown scripts.
> >
>
> Right.
>
> > Did I miss it? Maybe lxc-halt is a missing piece ;-) Is there a simple
> > way to do it, preventing the need to login to the container and run halt?
> >
>
> It is not possible to simply shutdown / reboot a container from outside.
>
> The lxc-halt commands family will be available when the "attach" to a
> container syscall, will be merged in the kernel upstream (crossing
> fingers we can have it soon).
>
> At present, there is a patchset at
> http://lxc.sourceforge.net/patches/linux/ providing this capability. And
> the lxc-attach command is already available. Halting a container should
> be done by "lxc-attach -n <name> /sbin/halt" and the lxc-halt command
> should be a trivial wrapper around lxc-attach.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>
At present we only can send signals to container init from host to invoke
halt process. This requires custom inittab and incompatible with upstart and
some other modern init systems, but it works well at least with debian and
gentoo.
This approach is used in ContainerKit and it's debian template.
You can read more at http://www.trueoffice.org/wiki/ContainerKit_en
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20100813/e67bb44c/attachment.html>


More information about the lxc-users mailing list