[lxc-users] Ubuntu container upstart and graceful shutdown

Robin Monjo robin.monjo at applidget.com
Thu Mar 20 08:19:51 UTC 2014


Thank you Serge, that is the thing I was looking for ! Every time great
support on this mailling list !


2014-03-19 19:14 GMT+01:00 Serge Hallyn <serge.hallyn at ubuntu.com>:

> Quoting Michael H. Warfield (mhw at WittsEnd.com):
> > 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".
>
> Since you're using upstart, why not just put
>
>         stop on starting rc RUNLEVEL=[016]
>
> in the upstart job?
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140320/2ccb9e28/attachment.html>


More information about the lxc-users mailing list