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.jae...@dnb.de] 
Sent: Monday, May 06, 2013 8:44 PM
To: David Parks; 'lxc-users@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.pa...@frugg.com>
mailto:david.pa...@frugg.com]

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

>To:  <mailto:lxc-users@lists.sourceforge.net>
lxc-users@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?

 

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to