On 05/25/2012 11:24 AM, Christian Seiler wrote: > Hi, > >> Have you looked at the lxc-shutdown script we have in Ubuntu and the >> integration we have with upstart? > > No, not yet, but I'll look at it later. > >> lxc-shutdown sends two different signals: >> reboot => SIGINT >> shutdown => SIGPWR >> >> These are caught by upstart and will trigger a clean reboot or >> shutdown >> of the container. It's what happens on shutdown of the host in 12.04 >> LTS. > > On a Debian container I had lying around here it had no effect > whatsoever, because there's nothing in the /etc/inittab catching it. > > Is it document behaviour that upstart shuts down on SIGPWR? (upstart > has no /etc/inittab where this may be configured, right?) Because if it > is that easy to cause upstart deterministically to shut down, then that > is definitely something we should use.
Upstart sends an event when it gets SIGPWR, in 12.04, I introduced a new job in upstart that triggers on it and triggers the shutdown: stgraber@castiana:~$ cat /etc/init/shutdown.conf # 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" > > Still, I think my initial rationale still holds that lxc-stop should > shut down by default, because I certainly didn't expect lxc-stop to kill > everything with SIGKILL when I tried it for the first time. So basically > all I'm saying is that Ubuntu's lxc-shutdown logic should be implemented > in lxc-stop and that it should be a bit more generic with the > possibility that the user can configure different methods in the config > file. I remember Serge and I discussed that at some point and ended up making it a separate tool. I can't remember the exact rational for this so I'll let Serge answer :) > > Regards, > Christian -- Stéphane Graber Ubuntu developer http://www.ubuntu.com
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel