From b916d749858cae4450140d50a5ba7da58636f16e Mon Sep 17 00:00:00 2001 From: Mu Xiaokang Date: Thu, 24 Apr 2014 12:41:53 +0800 Subject: [PATCH] Fix cgroup. modified: install_shell/cgroup-d5000-install/set_libcgroup.sh modified: setup.sh --- .../cgroup-d5000-install/set_libcgroup.sh | 25 +++++-------------- setup.sh | 2 +- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/install_shell/cgroup-d5000-install/set_libcgroup.sh b/install_shell/cgroup-d5000-install/set_libcgroup.sh index 2b473a3..df973da 100755 --- a/install_shell/cgroup-d5000-install/set_libcgroup.sh +++ b/install_shell/cgroup-d5000-install/set_libcgroup.sh @@ -1,5 +1,10 @@ #!/bin/sh +if [ -z $1 ];then + echo "Usage: ./set_libcgroup.sh " + exit 1 +fi + #设置开机启动项 echo "Starting set the boot startup..." @@ -66,17 +71,7 @@ mount { net_cls = /lxcg; }" -cgrules="*:start_kdeinit * / -*:startkde * / -*:kdeinit * / -*:kded * / -*:scim-launcher * / -*:scim-helper-manager * / -*:scim-panel-gtk * / -*:gam_server * / -*:kwrapper * / -*:artsd * / -*:korgac * /" +cgrules="$1: * /$1_limits" if [ ${total_mem} -le 500 ]; then mem_root=100 @@ -111,14 +106,6 @@ sed -i "/^$/d" /etc/cgrules.conf echo "$cgrules" >> /etc/cgrules.conf -users=`cut -d ':' -f1 /etc/passwd | sed -e '/root/d'` -for username in ${users} -do - if [ ${username} != "sysadmin" ] && [ ${username} != "sshd" ]; then - echo "${username}: * $1_limits" >> /etc/cgrules.conf - fi -done - #设置进程能力 echo "Starting set process capabilities..." setcap "=eip" /usr/sbin/cgconfigparser diff --git a/setup.sh b/setup.sh index 82bd4ed..c45237f 100755 --- a/setup.sh +++ b/setup.sh @@ -49,7 +49,7 @@ echo "===Set other===" cd cgroup-d5000-install -./set_libcgroup.sh $1 $2 $3 +./set_libcgroup.sh $1 echo "===Set cgroup==="