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.

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to