Subject: Please mount cgroup automatically

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

Package: initscripts
Severity: wishlist
Tag: patch

Hi,

please mount cgroup automatically in mountkernfs. patch will be sent as
soon as the bug number is assigned.

Regards,
Daniel

-- 
Address:        Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email:          [email-masked]
Internet:       http://people.panthera-systems.net/~daniel-baumann/

---

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

attached is the patch.

>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

---

From: Henrique de Moraes Holschuh <[email-masked]>
Date: Fri, 29 Oct 2010 15:43:38 -0200

> attached is the patch.

[...]

> +		domount cgroup "" /sys/fs/cgroup cgroup -onodev,noexec,nosuid

I like it.  Is this mountpoint "blessed" by someone, since it is inside
/sys?  Are other distros also using this path?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

---

From: Daniel Baumann <[email-masked]>
Date: Fri, 29 Oct 2010 20:33:57 +0200

> /sys?  Are other distros also using this path?

it's the upstream location to mount it, see comments in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595964
for more information.

---

From: Raphael Hertzog <[email-masked]>
Date: Wed, 3 Aug 2011 15:08:59 +0200

> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595964

Ping?

It looks like straightforward to fix, is there a reason why it has not yet
been done?

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)

---

From: Henrique de Moraes Holschuh <[email-masked]>
Date: Tue, 11 Nov 2014 16:55:34 -0200

> It looks like straightforward to fix, is there a reason why it has not yet

I don't know why it fell through the cracks in the first place, but when I
look at the bug report *now*, two things come to mind:

1. Is it *safe* and *undeniably always correct* to mount the cgroupfs in
   that mountpoint, with the mount options used in the patch?

   This answer needs only to take jessie into account.  But it does
   need to consider jessie's cgmanager and systemd at the very least,
   not just lxc.

2. How does it play with jessie's systemd and cgmanager (I hope the answer
   is: it doesn't cause any issues).

---

From: Raphael Hertzog <[email-masked]>
Date: Tue, 11 Nov 2014 22:48:36 +0100

>    is: it doesn't cause any issues).

I don't know the answers to those questions and the bug is now much less
relevant to me given that something else (likely systemd) does mount it
automatically for me, so I'm not going to spend time investigating your
questions.

Cheers,

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/

---

From: Henrique de Moraes Holschuh <[email-masked]>
Date: Tue, 11 Nov 2014 20:04:14 -0200

> automatically for me, so I'm not going to spend time investigating your

That's perfectly understandable.