diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-04-16 11:29:24 +0000 |
---|---|---|
committer | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-04-16 11:29:24 +0000 |
commit | 00e35b2d6a970edbb790b901fb7499f0f85e91b3 (patch) | |
tree | b20b52fc254c517bf44c2d72f8c30a03d5787893 /scripts/init.d | |
parent | 1603195881d3d7902a24cca1861f5808d50202db (diff) | |
download | libcg-00e35b2d6a970edbb790b901fb7499f0f85e91b3.tar.gz libcg-00e35b2d6a970edbb790b901fb7499f0f85e91b3.tar.xz libcg-00e35b2d6a970edbb790b901fb7499f0f85e91b3.zip |
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 <balbir@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@16 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'scripts/init.d')
-rwxr-xr-x | scripts/init.d/wlm | 65 |
1 files changed, 34 insertions, 31 deletions
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" |