Fix cgroup.

modified:   install_shell/cgroup-d5000-install/set_libcgroup.sh
	modified:   setup.sh
This commit is contained in:
Mu Xiaokang
2014-04-24 12:41:53 +08:00
parent 6b7f282d70
commit b916d74985
2 changed files with 7 additions and 20 deletions

View File

@@ -1,5 +1,10 @@
#!/bin/sh
if [ -z $1 ];then
echo "Usage: ./set_libcgroup.sh <username>"
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

View File

@@ -49,7 +49,7 @@ echo "===Set other==="
cd cgroup-d5000-install
./set_libcgroup.sh $1 $2 $3
./set_libcgroup.sh $1
echo "===Set cgroup==="