X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=lxc-pld.in.sh;h=d8d30aba6101e19b0cb669ec84335d5ec8c97c5a;hb=72d9317d6517f2ac0a75c4eec1c9a30db1ebb604;hp=c4d0680727ae85e648abeda9b6f6ff743560c555;hpb=81df689992ab74aebe7d1d7708d5d4c15f4bd0a0;p=packages%2Flxc.git diff --git a/lxc-pld.in.sh b/lxc-pld.in.sh index c4d0680..d8d30ab 100755 --- a/lxc-pld.in.sh +++ b/lxc-pld.in.sh @@ -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() @@ -173,7 +169,7 @@ copy_pld() # make a local copy of the minipld echo -n "Copying rootfs to $rootfs_path ..." - cp -a $cache/rootfs/ $rootfs_path || return 1 + cp -a $cache/rootfs/* $rootfs_path || return 1 return 0 } @@ -187,7 +183,7 @@ install_pld() { mkdir -p @LOCALSTATEDIR@/lock/subsys/ ( - flock -x 200 + flock -x 9 if [ $? -ne 0 ]; then echo "Cache repository is busy." return 1 @@ -218,7 +214,7 @@ install_pld() fi return 0 - ) 200>@LOCALSTATEDIR@/lock/subsys/lxc-pld + ) 9>@LOCALSTATEDIR@/lock/subsys/lxc-pld return $? } @@ -287,7 +283,7 @@ clean() # lock, so we won't purge while someone is creating a repository ( - flock -x 200 + flock -x 9 if [ $? != 0 ]; then echo "Cache repository is busy." exit 1 @@ -296,7 +292,7 @@ clean() echo -n "Purging the download cache for PLD Linux $release..." rm --preserve-root --one-file-system -rf $cache && echo "Done." || exit 1 exit 0 - ) 200>@LOCALSTATEDIR@/lock/subsys/lxc-pld + ) 9>@LOCALSTATEDIR@/lock/subsys/lxc-pld } usage() @@ -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