X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvserver.functions;h=808fcd1800960ff3115feac0d9810bb733c3b051;hb=d641b1e3fac4d105ac0c7d0739d4cff765387264;hp=1367676d2e972edb948860115308bdf97c784414;hpb=ec80c7ae48c156ef33f335e51b55f897559495ad;p=util-vserver.git diff --git a/scripts/vserver.functions b/scripts/vserver.functions index 1367676..808fcd1 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -1416,11 +1416,19 @@ function _namespaceCleanup done done + # keep cgroup mount points + list=( "${list[@]}" "${CGROUP_MNT}" ) + if test -n "$CGROUP_MNT_PER_SS"; then + for ss in "${CGROUP_SUBSYS[@]}"; do + list=( "${list[@]}" "${CGROUP_MNT}/${ss}" ) + done + fi + local -a list_umount while read -r dev path opts; do test -n "$path" || continue - for i in "$root" /dev /proc; do - path_dir="${path}/" + path_dir="${path}/" + for i in "$root" /dev /proc /sys; do test "${path_dir#${i}/}" != "${path_dir}" && continue 2 done for i in "${list[@]}" /; do @@ -1474,15 +1482,18 @@ function _generateCgroupOptions hasCgroup || return 0 - findFile file "$__CONFDIR/.defaults/cgroup/mnt" "" - if test -n "$file"; then - read CGROUP_MNT < "$file" - fi findFile file "$__CONFDIR/.defaults/cgroup/subsys" "" if test -n "$file"; then _readFileToArray CGROUP_SUBSYS "$file" else - CGROUP_SUBSYS=( $($_AWK '/^#/ { next; } $1 == "ns" { next; } $4 != "0" { printf "%s%s", s, $1; s=","; }' /proc/cgroups) ) + CGROUP_SUBSYS=( $($_AWK '/^#/ { next; } $1 == "ns" { next; } $4 != "0" { print $1; }' /proc/cgroups) ) + fi + findFile file "$__CONFDIR/.defaults/cgroup/mnt" "" + if test -n "$file"; then + read CGROUP_MNT < "$file" + elif test -d /sys/fs/cgroup -a -d /sys/fs/cgroup/"${CGROUP_SUBSYS[0]}"; then + CGROUP_MNT=/sys/fs/cgroup + CGROUP_MNT_PER_SS=1 fi findFile file "$__CONFDIR/.defaults/cgroup/inherit" "" if test -n "$file"; then