]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
plamo: Improve template for lxc-stop
authorKATOH Yasufumi <karma@jazz.email.ne.jp>
Wed, 25 Dec 2013 04:45:24 +0000 (13:45 +0900)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 25 Dec 2013 16:06:55 +0000 (17:06 +0100)
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@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-plamo.in

index b133da3069e05d29b96455493af32004628a3453..485f36304c87fb78b945e5b648316500fa407d4f 100644 (file)
@@ -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