]> git.pld-linux.org Git - packages/libcgroup.git/commitdiff
- rel 2; mount tmpfs for /sys/fs/cgroup if not already mounted auto/th/libcgroup-0_38-0_rc1_2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 28 Feb 2012 16:31:00 +0000 (16:31 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cgconfig.init -> 1.11
    libcgroup.spec -> 1.27

cgconfig.init
libcgroup.spec

index 2d1feaf9946e1bd679120fee0295bd5d86f128a2..1dfe53812be5def4601a697366fbcbc1ec6892e7 100644 (file)
 # 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 @@ start() {
                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 @@ stop() {
 
        msg_stopping "cgconfig"
        cgclear
+       RETVAL=$?
        cgclear
        rm -f /var/lock/subsys/cgconfig
        ok
+       umount_cgroup
 }
 
 condrestart() {
index ccf881129915e441624a225c8cb064aede9ce119..3ec2f7e168e78355829557fbfd3889be37591b97 100644 (file)
@@ -3,7 +3,7 @@ Summary:        Tools and library to control and monitor control groups
 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
This page took 0.139506 seconds and 4 git commands to generate.