X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvuseradd;h=9ace75c385546747d80f1102e662eb631e69e3bc;hb=289a5b5d7a75dcef7f4cc6ef1ee258e3938311ea;hp=b54aec9204d08a164c5b60065b9931e07296e46f;hpb=a6e1134d8bdb41b0146cdac83e4e82909e74cb47;p=util-vserver-pl.git diff --git a/scripts/vuseradd b/scripts/vuseradd index b54aec9..9ace75c 100755 --- a/scripts/vuseradd +++ b/scripts/vuseradd @@ -87,13 +87,17 @@ if [ ! -d $__CONFDIR/$NAME ] ; then echo "Error $RETVAL building $DIR" rm -rf $DIR $__DEFAULT_VSERVERDIR/$NAME fi - mkdir -p $DIR/apps/init $DIR/rlimits $DIR/sched $DIR/dlimits/0 $DIR/sysctl/0 + mkdir -p $DIR/apps/init $DIR/rlimits $DIR/sched $DIR/cgroup $DIR/dlimits/0 $DIR/sysctl/0 echo default > $DIR/apps/init/mark echo 1000 > $DIR/rlimits/nproc.hard # Set persistent for the network context echo persistent,lback_allow > $DIR/nflags + # Set default capabilities + echo "CAP_NET_RAW" > $DIR/bcapabilities + echo "" > $DIR/ccapabilities + # Set up the scheduler echo 100 > $DIR/sched/interval echo 1000 > $DIR/sched/interval2 @@ -104,19 +108,18 @@ if [ ! -d $__CONFDIR/$NAME ] ; then echo 50 > $DIR/sched/tokens-min echo 100 > $DIR/sched/tokens-max - # Set up disk limits (unlimited) + echo 1024 > $DIR/cgroup/cpu.shares + + # Set up disk limits (10 GB) echo `$_READLINK $DIR/vdir` > $DIR/dlimits/0/directory echo 2 > $DIR/dlimits/0/reserved echo -1 > $DIR/dlimits/0/inodes_total - echo -1 > $DIR/dlimits/0/space_total + echo 10000000 > $DIR/dlimits/0/space_total # Set up sysctl variables echo net.ipv4.ip_forward > $DIR/sysctl/0/setting echo 1 > $DIR/sysctl/0/value - # Disable mount namespaces - touch $DIR/nonamespace - # Add spaces directory mkdir -p $DIR/spaces