[Lxc-users] Best way to shutdown a container

Dobrica Pavlinusic dpavlin at rot13.org
Tue Aug 17 16:22:08 UTC 2010


On Tue, Aug 17, 2010 at 04:43:04PM +0100, Gordon Henderson wrote:
> On Fri, 13 Aug 2010, 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.
> >
> > 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?
> 
> Am I the only one using lxc-watchdog by Dobrica Pavlinusic ?
> 
> http://blog.rot13.org/2010/03/lxc-watchdog_missing_bits_for_openvz_-_linux_containers_migration.html

Nop, there are at least two of us :-)

> I've had to tweak it a bit for my own setup, but otherwise it seems to 
> work OK.
> 
> It modified a containers inittab at start time and then sends a powerfail 
> event to it's running init to simulate a reboot...

I don't understand this change. Can I see diff?

I would also suggest to add logrotate on files generated in /tmp/ since
container output can get quite large, depending on what is dumped to
your console during lifetime of container.

-- 
Dobrica Pavlinusic               2share!2flame            dpavlin at rot13.org
Unix addict. Internet consultant.             http://www.rot13.org/~dpavlin




More information about the lxc-users mailing list