[Lxc-users] [Spam-Wahrscheinlichkeit=87] Restarting LXC containers after power failure

David Parks davidparks21 at yahoo.com
Mon May 6 14:08:39 UTC 2013


Ah, I wasn't aware of the startup/shutdown hook scripts either, that'll be a
perfect place to add/remove the symbolic link in /etc/lxc/auto

 

Do you know if lxc.hook.post-stop is run even if you power off from within
the container with shutdown -P now?

 

Also, can I define multiple post-stop hooks? For example, if I wanted to run
2 commands but didn’t want to distribute a custom script to all my hosts?
The Ubuntu docs don’t call that point out specifically.

 

Thanks much,

David

 

 

-----Original Message-----
From: Jäkel, Guido [mailto:G.Jaekel at dnb.de] 
Sent: Monday, May 06, 2013 8:44 PM
To: David Parks; 'lxc-users at lists.sourceforge.net'
Cc: Ha Ho
Subject: RE: [Spam-Wahrscheinlichkeit=87][Lxc-users] Restarting LXC
containers after power failure

 

Dear David,

 

this will require to persist the current "power state" of a container by
some kind of marker.  A tricky way is to mark some container-related file,
e.g. to ("miss"-) use the sticky bit of the containers lxc configuration
file or to put some marker file into the containers rootfs.

 

This will allow to write an init script that will scan for such a marker and
(re)start the corresponding container. Using LXC's startup/shutdown hook
scripts, you may event set such a marker automagical and especially to
remove it on a regular shutdown. 

 

 

 

>-----Original Message-----

>From: David Parks [ <mailto:david.parks at frugg.com>
mailto:david.parks at frugg.com]

>Sent: Monday, May 06, 2013 2:59 PM

>To:  <mailto:lxc-users at lists.sourceforge.net>
lxc-users at lists.sourceforge.net

>Cc: Ha Ho

>Subject: [Spam-Wahrscheinlichkeit=87][Lxc-users] Restarting LXC 

>containers after power failure

> 

>We just had a datacenter power failure, upon restart of course our LXC 

>containers were stopped. It would be just dandy if there were an LXC option
to restart the containers that were already running before the sudden
failure.

> 

> 

> 

>Is there any such capability?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130506/3ca77c1b/attachment.html>


More information about the lxc-users mailing list