[lxc-users] Ubuntu container upstart and graceful shutdown

Michael H. Warfield mhw at WittsEnd.com
Wed Mar 19 18:04:49 UTC 2014


On Wed, 2014-03-19 at 18:21 +0100, Robin Monjo wrote:
> Hello,
> 
> 
> I'm using LXC 0.7.5 with the stock ubuntu template. My containers are
> running ruby processes that are managed by upstart (launched by
> upstart scripts). 
> 
> 
> I need these processes to be gracefully stopped when shutting down a
> container, i.e send the SIGTERM signal and wait for it to be done
> before fully shutting down my container.
> 
> 
> I see that inside a container, upstart listen for the SIPWR signal and
> execute "shutdown -h now "SIGPWR received"", is it safe to remove this
> in order to achieve my goal ? Or is there any other alternatives ?

Ok...  So, why not use a SIGPWR?  That's the convention.  Are you
married to using SIGTERM for this purpose?  I'm just getting ready to
make sure the Fedora and CentOS templates adhere to the SIGPWR
convention for both Upstart and Systemd.  Why SIGTERM now?

And the simple answer to your question is "no, it is not safe - it will
cause other timeouts, delays, and problems".

> Regards,
> Robin

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140319/768ffb3c/attachment.pgp>


More information about the lxc-users mailing list