Subject: Bug#601757: Please mount cgroup automatically

From: Daniel Baumann <[email-masked]>
Date: Fri, 29 Oct 2010 12:48:04 +0200

attached is the patch.

-- 
Address:        Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email:          [email-masked]
Internet:       http://people.panthera-systems.net/~daniel-baumann/
From 8f5974c07aa6e7fa16b4992a5d115cd772137ae7 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <[email-masked]>
Date: Fri, 29 Oct 2010 12:39:26 +0200
Subject: [PATCH] Automatically mounting cgroup on /sys/fs/cgroup if it is supported (Closes: #601757).

---
 debian/src/initscripts/etc/init.d/mountkernfs.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/debian/src/initscripts/etc/init.d/mountkernfs.sh b/debian/src/initscripts/etc/init.d/mountkernfs.sh
index f3222b8..7c53f98 100644
--- a/debian/src/initscripts/etc/init.d/mountkernfs.sh
+++ b/debian/src/initscripts/etc/init.d/mountkernfs.sh
@@ -46,6 +46,15 @@ do_start () {
 		domount sysfs "" /sys sysfs -onodev,noexec,nosuid
 	fi
 
+	#
+	# Mount cgroup on /sys/fs/cgroup
+	#
+	# Only mount sysfs if it is supported (kernel >= 2.6.32)
+	if grep -E -qs "cgroup\$" /proc/filesystems && [ -d /sys/fs/cgroup ]
+	then
+		domount cgroup "" /sys/fs/cgroup cgroup -onodev,noexec,nosuid
+	fi
+
 	# Mount /var/run and /var/lock as tmpfs if enabled
 	if [ yes = "$RAMRUN" ] ; then
 		RUN_OPT=
-- 
1.7.2.3