[Lxc-users] container shutdown

Serge Hallyn serge.hallyn at canonical.com
Mon Mar 19 02:50:17 UTC 2012


Quoting Daniel Lezcano (daniel.lezcano at free.fr):
> On 03/19/2012 12:00 AM, Serge Hallyn wrote:
> >Hi,
> >
> >Thanks to Jäkel's and Fajar's great ideas, we can now cleanly shut down
> >a container by sending it SIGPWR.  I'm attaching two ways to do that.
> >In-line is a patch which modifies lxc-stop to take optional -s and -t
> >args - -s for shutdown (meaning send SIGPWR), and -t for a timeout,
> >after sending SIGPWR, to hard-kill the container.
> 
> That may make more sense to implement a lxc-reboot | lxc-shutdow

Is there another signal that would make sense for lxc-reboot?

> script on top of on lxc-kill.
> 
> IMHO, I don't think adding a timeout is a good idea because the
> shutdown process may take more than the timeout to stop the services
> and the container could be killed while the services are doing some
> cleanup or flush or whatever. If this option is present, people will
> tend to use it instead of investigating if a service is stuck, or
> working, or flushing.
> I would recommend to let the shutdown script to handle the timeout
> by themselves.

By 'let the shutdown script to handle the timeout by themselves", you
mean let the scripts calling lxc-shutdown handle the timeout?  And
leave lxc-shutdown to be as simple as 'lxc-kill -n $1 SIGPWR" ?

thanks,
-serge




More information about the lxc-users mailing list