X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvserver.functions;h=228c70b43ac3d0f1ffa86eb7f67d881390d42fc1;hb=e863891f2cb12e9087f01e34f5d5c38c733a53a1;hp=dc6427e4976bea6bf076b14b1ad633d012e9e75a;hpb=a923f0462d73c4f46c639b8ec4eb86e189047586;p=util-vserver.git diff --git a/scripts/vserver.functions b/scripts/vserver.functions index dc6427e..228c70b 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -1496,9 +1496,8 @@ function _handleCgroup useCgroup "$vdir" || return 0 findDir dir "$vdir/cgroup" "$__CONFDIR/.defaults/cgroup" "" - test -d "$dir" || return 0 - if test -r "$dir"/name; then + if test -n "$dir" -a -r "$dir"/name; then read name < "$dir"/name else name="$VSERVER_NAME" @@ -1513,13 +1512,15 @@ function _handleCgroup cat "$parent/$i" > "$CGROUP_MNT/$name/$i" done - shopt -s nullglob - for i in "$dir"/*; do - f="${i##*/}" - test "$f" != mnt -a "$f" != subsys -a \ - "$f" != inherit -a "$f" != name || continue - cat "$i" > "$CGROUP_MNT/$name/$f" - done + if test -n "$dir"; then + shopt -s nullglob + for i in "$dir"/*; do + f="${i##*/}" + test "$f" != mnt -a "$f" != subsys -a \ + "$f" != inherit -a "$f" != name || continue + cat "$i" > "$CGROUP_MNT/$name/$f" + done + fi fi echo "$$" > "$CGROUP_MNT/$name/tasks" elif test "$action" = "destroy"; then