]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Fixed an initscripts problem. Comments were not ignored in the second
authorBalbir Singh <balbir@linux.vnet.ibm.com>
Wed, 16 Apr 2008 11:29:24 +0000 (11:29 +0000)
committerBalbir Singh <balbir@linux.vnet.ibm.com>
Wed, 16 Apr 2008 11:29:24 +0000 (11:29 +0000)
level configuration file (i.e. cpu.conf)

 wlm |   65 ++++++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 34 insertions(+), 31 deletions(-)

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@16 4f4bb910-9a46-0410-90c8-c897d4f1cd53

scripts/init.d/wlm

index ed463f60e4a905236590a21cffe33bbb195505b6..d4e1dd751c5d46358d5b5d8afbdb59595af7d6a4 100755 (executable)
@@ -41,37 +41,40 @@ parse_controller_file() {
                'mount')
                        ;;
                *)
-                       echo "Creating class $name"
-                       class=$name
-                       mkdir -p $MOUNTPOINT/$class
-                       cd $MOUNTPOINT/$class
-
-                       if echo $opts | grep -q "="
+                       if ! echo $name | grep -q ^#
                        then
-                               for single_opt in $opts
-                               do
-                                       cf=`echo $single_opt | cut -d '=' -f1`
-                                       co=`echo $single_opt | cut -d '=' -f2`
-                                       case $cf in
-                                       "tuid")
-                                               tuid=$co
-                                               ;;
-                                       "cuid")
-                                               cuid=$co
-                                               ;;
-                                       "tgid")
-                                               tgid=$co
-                                               ;;
-                                       "cgid")
-                                               cgid=$co
-                                               ;;
-                                       *)
-                                               echo -n $co > $cf
-                                               ;;
-                                       esac
-                               done
-                               chown -R $cuid:$cgid $MOUNTPOINT/$class
-                               chown -R $tuid:$tgid $MOUNTPOINT/$class/tasks
+                               echo "Creating class $name"
+                               class=$name
+                               mkdir -p $MOUNTPOINT/$class
+                               cd $MOUNTPOINT/$class
+
+                               if echo $opts | grep -q "="
+                               then
+                                       for single_opt in $opts
+                                       do
+                                               cf=`echo $single_opt | cut -d '=' -f1`
+                                               co=`echo $single_opt | cut -d '=' -f2`
+                                               case $cf in
+                                               "tuid")
+                                                       tuid=$co
+                                                       ;;
+                                               "cuid")
+                                                       cuid=$co
+                                                       ;;
+                                               "tgid")
+                                                       tgid=$co
+                                                       ;;
+                                               "cgid")
+                                                       cgid=$co
+                                                       ;;
+                                               *)
+                                                       echo -n $co > $cf
+                                                       ;;
+                                               esac
+                                       done
+                                       chown -R $cuid:$cgid $MOUNTPOINT/$class
+                                       chown -R $tuid:$tgid $MOUNTPOINT/$class/tasks
+                               fi
                        fi
                esac
        done < $file
@@ -196,7 +199,7 @@ start() {
 
 move_all_to_init_class() {
        cd $MOUNTPOINT
-       cat /proc/mounts | grep -w $MOUNTPOINT
+       cat /proc/mounts | grep -wq $MOUNTPOINT
        if [ $? -ne 0 ]
        then
                echo "resource control filesystem not mounted"