[Lxc-users] Best way to shutdown a container
Ralf Schmitt
ralf at brainbot.com
Fri Aug 13 14:42:13 UTC 2010
Daniel Lezcano <daniel.lezcano at free.fr> writes:
> 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.
As a workaround I use the following script:
http://gist.github.com/522980
It send's ctrl-c ("ctrl-alt-del") to the init process in the container
and waits until only one process is running.
More information about the lxc-users
mailing list