From 00e35b2d6a970edbb790b901fb7499f0f85e91b3 Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Wed, 16 Apr 2008 11:29:24 +0000 Subject: Fixed an initscripts problem. Comments were not ignored in the second level configuration file (i.e. cpu.conf) wlm | 65 ++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) Signed-off-by: Balbir Singh git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@16 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- scripts/init.d/wlm | 65 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'scripts') diff --git a/scripts/init.d/wlm b/scripts/init.d/wlm index ed463f6..d4e1dd7 100755 --- a/scripts/init.d/wlm +++ b/scripts/init.d/wlm @@ -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" -- cgit