From 2198bce8b4e20700ca72473140980208d0937e9d Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Fri, 17 Feb 2012 10:22:03 +0100 Subject: [PATCH] Check if /sys/fs/cgroup is used --- scripts/vserver.functions | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/vserver.functions b/scripts/vserver.functions index 1367676..f528d30 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -1474,16 +1474,19 @@ 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) ) 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 _readFileToArray CGROUP_INHERIT "$file" "" -- 1.8.1.5