--- recepies/lxc/lxc-watchdog.sh 2010/08/10 17:03:15 226 +++ recepies/lxc/lxc-watchdog.sh 2010/09/07 16:02:12 227 @@ -73,7 +73,7 @@ # let container respond to kill -SIGPWR inittab=$rootfs/etc/inittab - if ! grep "$add" ${inittab} >/dev/null ; then + if test -e $inittab && ! grep "$add" ${inittab} >/dev/null ; then grep -v "$remove" ${inittab} > ${inittab}.new echo $add >> ${inittab}.new mv ${inittab}.new ${inittab} @@ -111,6 +111,12 @@ lxc_start() { name=$1 + rootfs=$(lxc_rootfs $1) + + if [ ! -e $rootfs ] ; then + echo "ERROR $name rootfs $rootfs not found" + return + fi if ! lxc-info -n $name | grep RUNNING ; then lxc_log "$name start"