[Lxc-users] Best way to shutdown a container

Daniel Lezcano daniel.lezcano at free.fr
Fri Aug 13 14:34:34 UTC 2010


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.




More information about the lxc-users mailing list