[Lxc-users] Graceful shutdowns: current best practices?

Ulli Horlacher framstag at rus.uni-stuttgart.de
Tue Oct 18 23:07:05 UTC 2011


On Tue 2011-10-18 (15:22), Derek Simkowiak wrote:
> What is the best method for gracefully shutting down LXC containers 
> in a production environment?

I use "lxc -s container" which itself executes a "shutdown -h now" via
cmdd, see: http://fex.rus.uni-stuttgart.de/lxc.html


> lxc-attach -n CONTAINER shutdown -h now
> 
>      Is there any drawback to doing that, instead? 

root at vms2:~# lxc-attach -n bunny -- shutdown -h now
lxc-attach: Does this kernel version support 'attach' ?
lxc-attach: failed to enter the namespace

root at vms2:~# uname -a
Linux vms2 2.6.35-30-server #59~lucid1-Ubuntu SMP Thu Sep 1 19:39:17 UTC 2011 x86_64 GNU/Linux


> 3. An "official" command name for graceful shutdowns from the host.  I 
> propose lxc-shutdown.  (There is an unofficial OpenSuse package from 
> rdannert that has a "lxc-shutdown-all" command, but I have not seen the 
> name "lxc-shutdown" used anywhere.)
> 
> 4. Which signal?  SIGINT?  SIGPWR?  Both?

Does only work for init based systems, not for upstart, like Ubuntu!


-- 
Ullrich Horlacher              Server- und Arbeitsplatzsysteme
Rechenzentrum                  E-Mail: horlacher at rus.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-685-65868
Allmandring 30                 Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/




More information about the lxc-users mailing list