packages: libcgroup/cgconfig.init, libcgroup/libcgroup.spec - rel 2; mount ...

arekm arekm at pld-linux.org
Tue Feb 28 17:31:05 CET 2012


Author: arekm                        Date: Tue Feb 28 16:31:05 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 2; mount tmpfs for /sys/fs/cgroup if not already mounted

---- Files affected:
packages/libcgroup:
   cgconfig.init (1.10 -> 1.11) , libcgroup.spec (1.26 -> 1.27) 

---- Diffs:

================================================================
Index: packages/libcgroup/cgconfig.init
diff -u packages/libcgroup/cgconfig.init:1.10 packages/libcgroup/cgconfig.init:1.11
--- packages/libcgroup/cgconfig.init:1.10	Mon Feb 13 21:03:04 2012
+++ packages/libcgroup/cgconfig.init	Tue Feb 28 17:31:00 2012
@@ -12,6 +12,31 @@
 # read the config
 [ -f /etc/sysconfig/cgconfig ] && . /etc/sysconfig/cgconfig
 
+mount_cgroup() {
+	if [ -n "`grep /sys/fs/cgroup /proc/mounts`" ]; then
+		return 0
+	fi
+
+	# kernel provides cgroups?
+	if [ ! -e /proc/cgroups ]; then
+		return 0
+	fi
+
+	run_cmd "Mounting /sys/fs/cgroup" mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
+}
+
+umount_cgroup() {
+	# If /sys/fs/cgroup is not mounted, we don't bother
+	if [ -z "`grep /sys/fs/cgroup /proc/mounts`" ]; then
+		return 0
+	fi
+
+	# Don't try to get too smart, just optimistically try to umount all
+	# that we think we mounted
+	run_cmd "Unmounting /sys/fs/cgroup" umount /sys/fs/cgroup
+	return $?
+}
+
 start() {
 	# Check if the service is already running?
 	if [ -f /var/lock/subsys/cgconfig ]; then
@@ -23,6 +48,7 @@
 		RETVAL=6
 		return
 	fi
+	mount_cgroup
 	msg_starting "cgconfig"; busy
 	local out
 	out=$(/sbin/cgconfigparser -l /etc/cgconfig.conf 2>&1)
@@ -46,9 +72,11 @@
 
 	msg_stopping "cgconfig"
 	cgclear
+	RETVAL=$?
 	cgclear
 	rm -f /var/lock/subsys/cgconfig
 	ok
+	umount_cgroup
 }
 
 condrestart() {

================================================================
Index: packages/libcgroup/libcgroup.spec
diff -u packages/libcgroup/libcgroup.spec:1.26 packages/libcgroup/libcgroup.spec:1.27
--- packages/libcgroup/libcgroup.spec:1.26	Mon Feb 13 21:03:04 2012
+++ packages/libcgroup/libcgroup.spec	Tue Feb 28 17:31:00 2012
@@ -4,7 +4,7 @@
 Summary(pl.UTF-8):	Narzędzia i biblioteka do kontrolowania i monitorowania grup kontroli
 Name:		libcgroup
 Version:	0.38
-Release:	0.%{_rc}.1
+Release:	0.%{_rc}.2
 License:	LGPL v2+
 Group:		Libraries
 Source0:	http://downloads.sourceforge.net/libcg/%{name}-%{version}.%{_rc}.tar.bz2
@@ -225,6 +225,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.27  2012/02/28 16:31:00  arekm
+- rel 2; mount tmpfs for /sys/fs/cgroup if not already mounted
+
 Revision 1.26  2012/02/13 20:03:04  baggins
 - 0.38.rc1
 - removed obsolete patches
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/libcgroup/cgconfig.init?r1=1.10&r2=1.11&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/libcgroup/libcgroup.spec?r1=1.26&r2=1.27&f=u



More information about the pld-cvs-commit mailing list