[Lxc-users] lxc-shutdown and guests running upstart

Johannes Graumann johannes_graumann at web.de
Sun Sep 22 17:44:08 UTC 2013


Stéphane Graber wrote:

> On Sun, Sep 22, 2013 at 02:00:08PM +0300, Johannes Graumann wrote:
>> Hello,
>> 
>> When setting up a centos lxc container from scratch I ran into the fact
>> that (according to my interpretation of my extensive googling)
>> upstart-running distributions cannot be gracefully coerced into shutting
>> down via "lxc- shutdown" ... this is true for both my manual centos and a
>> lxc-fedora generated fedora container ...
>> 
>> I have not found a way around this. Can anyone share how to configure an
>> upstart guest to listen to a "kill -s INT $pid" and/or "kill -s PWR $pid"
>> as used by lxc-shutdown?
>> 
>> Thank you for any hints.
>> 
>> Sincerely, Joh
> 
> Hmm, that's surprising, it definitely works fine on Ubuntu.
> 
> My guess is that you're missing the upstart job which reacts on SIGPWR
> being received by PID1.
> 
> Try adding this as /etc/init/shutdown.conf in your container:
> """
> # Trigger an immediate shutdown when upstart receives SIGPWR
> # this is useful for some UPS monitoring tools and for clean
> # shutdown of containers
> 
> description "Trigger an immediate shutdown on SIGPWR"
> start on power-status-changed
> 
> task
> exec shutdown -h now "SIGPWR received"
> """
> 
> After that lxc-shutdown should work fine.

Thank you. This seems to have done it ... takes long, but works.

Joh





More information about the lxc-users mailing list