Allow something else to mount the cgroup hierarchy
[util-vserver.git] / scripts / vserver-init.functions
index 32c65d9..fef3c82 100755 (executable)
@@ -91,7 +91,8 @@ function mount_cgroup()
     if test -n "$CGROUP_MNT_PER_SS"; then
        for ss in "${CGROUP_SUBSYS[@]}"; do
            $_MKDIR -p "$CGROUP_MNT/$ss"
-           $_MOUNT -t cgroup -o "$ss" vserver "$CGROUP_MNT/$ss"
+           $_GREP -q "$CGROUP_MNT/$ss" /proc/mounts || \
+               $_MOUNT -t cgroup -o "$ss" vserver "$CGROUP_MNT/$ss"
        done
     else
        oIFS="$IFS"