Add powerfail entries for lxc-shutdown in sysvinit script.
authorDaniel Baumann <daniel@debian.org>
Mon, 26 Nov 2012 20:19:43 +0000 (21:19 +0100)
committerDaniel Baumann <daniel@debian.org>
Mon, 26 Nov 2012 20:19:43 +0000 (21:19 +0100)
scripts/debconfig/0030-sysvinit

index 764ff92..1459897 100755 (executable)
@@ -129,6 +129,17 @@ case "${_LXC_ENABLE}" in
 
                sed -i -e "s|\(${_CONSOLE}\)|\1${_CONSOLES}|" /etc/inittab.tmp
 
+               # Enable powerfail entries for lxc-shutdown
+               if ! grep -qs ^p0:: /etc/inittab.tmp
+               then
+                       echo "p0::powerfail:/sbin/init 0" >> /etc/inittab.tmp
+               fi
+
+               if ! grep -qs ^p6:: /etc/inittab.tmp
+               then
+                       echo "p6::ctrlaltdel:/sbin/init 6" >> /etc/inittab.tmp
+               fi
+
                mv /etc/inittab.tmp /etc/inittab
 
                # squeeze and newer only has /dev/tty and /dev/tty0 by default,