[Lxc-users] Best way to shutdown a container

Bodhi Zazen bodhi.zazen at montanalinux.org
Mon Aug 16 16:24:54 UTC 2010


Upstart is a problem in linux containers (as well as openvz).

>From the release notes :

https://wiki.ubuntu.com/LucidLynx/ReleaseNotes#Upstart%20jobs%20cannot%20be%20run%20in%20a%20chroot

quote - "Upstart jobs cannot be started in a chroot because upstart acts as a service supervisor, and processes within the chroot are unable to communicate with the upstart running outside of the chroot (430224). This will cause some packages that have been converted to use upstart jobs instead of init scripts to fail to upgrade within a chroot. Users are advised to configure their chroots with /sbin/initctl pointing to /bin/true, with the following commands run within the chroot:

dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl"

Hope that helps, but you will have to try it.

Personally I find I eliminate as many /etc/init (upstart) script as possible and modify (simplify) the ones I keep.

bodhi.zazen

----- Original Message -----
From: "Osvaldo Filho" <arquivostcf at gmail.com>
To: "Ralf Schmitt" <ralf at brainbot.com>
Cc: lxc-users at lists.sourceforge.net
Sent: Saturday, August 14, 2010 6:15:16 AM
Subject: Re: [Lxc-users] Best way to shutdown a container

This work with Upstart (Ubuntu 10.04)?

2010/8/13 Ralf Schmitt <ralf at brainbot.com>:
> 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.
>
> ------------------------------------------------------------------------------
> 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
>

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




More information about the lxc-users mailing list