Fix cgroup.
modified: install_shell/cgroup-d5000-install/set_libcgroup.sh modified: setup.sh
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user