]> git.pld-linux.org Git - packages/lxc.git/blobdiff - lxc-pld.in.sh
- python3 rebuild
[packages/lxc.git] / lxc-pld.in.sh
index ca1677a8dbff63103a9aab985883f5d242769f95..d8d30aba6101e19b0cb669ec84335d5ec8c97c5a 100755 (executable)
@@ -103,12 +103,8 @@ EOF
 
 configure_pld_init()
 {
-       # Setup getty service on the 4 ttys we are going to allow in the
-       # default config. Number should match lxc.tty
-#      sed -i -e 's///' ${rootfs_path}/etc/inittab
-
-       # nothing done here yet
-       :
+       # default powerfail action waits 2 minutes. for lxc we want it immediately
+       sed -i -e '/^pf::powerfail:/ s,/sbin/shutdown.*,/sbin/halt,' ${rootfs_path}/etc/inittab
 }
 
 configure_pld_systemd()
@@ -411,12 +407,15 @@ if [ "$(id -u)" != "0" ]; then
        exit 1
 fi
 
-if [ -z "$rootfs_path" ]; then
-       rootfs_path=$path/rootfs
-       # check for 'lxc.rootfs' passed in through default config by lxc-create
-       if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
-               rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
-       fi
+if [ -z "$rootfs" ]; then
+    rootfs_path=$path/rootfs
+    # check for 'lxc.rootfs' passed in through default config by lxc-create
+    # TODO: should be lxc.rootfs.mount used instead?
+    if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
+            rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
+    fi
+else
+    rootfs_path=$rootfs
 fi
 config_path=$default_path/$name
 cache=$cache_base/$release
This page took 0.038812 seconds and 4 git commands to generate.