lxc_watchdog() {
name=$1
+cgroup=$(mount -t cgroup | awk '{ print $3 }')
+test -d "$cgroup/lxc/$1" && cgroup="$cgroup/lxc"
rootfs=$(lxc_rootfs $1)
run=$rootfs/var/run
test -L $run && run=$rootfs/`readlink $run` # recent Debian have symlink to /run
cd $run || echo "can't cd watchdog into $run"
while true; do
- tasks=`wc -l < /cgroup/${name}/tasks`
+ tasks=`wc -l < $cgroup/${name}/tasks`
stop_on=1 # init
sulogins=`lxc-ps --name $name | grep sulogin | wc -l`
if [ "$sulogins" -gt 0 ] ; then