[lxc-devel] [PATCH] plamo: Improve template for lxc-stop
KATOH Yasufumi
karma at jazz.email.ne.jp
Wed Dec 25 04:45:24 UTC 2013
patch /etc/inittab in plamo container to shutdown when it receives SIGPWR.
(By default, plamo shutdowns to single user mode after 5minutes)
Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
---
templates/lxc-plamo.in | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/templates/lxc-plamo.in b/templates/lxc-plamo.in
index b133da3..485f363 100644
--- a/templates/lxc-plamo.in
+++ b/templates/lxc-plamo.in
@@ -178,6 +178,12 @@ configure_plamo() {
EOF
# /etc/inittab
cat <<- "EOF" | patch $rootfs/etc/inittab
+ 32,33c32,33
+ < # What to do when power fails (shutdown to single user).
+ < pf::powerfail:/sbin/shutdown -f +5 "THE POWER IS FAILING"
+ ---
+ > # What to do when power fails (shutdown).
+ > pf::powerfail:/sbin/shutdown -h +0 "THE POWER IS FAILING"
47a48
> 1:1235:respawn:/sbin/agetty 38400 console
52,53d52
--
1.8.4.4
More information about the lxc-devel
mailing list