git://git.onelab.eu
/
util-vserver-pl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
88d249d
)
set default values correctly
author
S.Çağlar Onur
<caglar@cs.princeton.edu>
Fri, 16 Jul 2010 19:37:12 +0000
(15:37 -0400)
committer
S.Çağlar Onur
<caglar@cs.princeton.edu>
Fri, 16 Jul 2010 19:37:12 +0000
(15:37 -0400)
scripts/vuseradd
patch
|
blob
|
history
diff --git
a/scripts/vuseradd
b/scripts/vuseradd
index
ac2d359
..
9ace75c
100755
(executable)
--- 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
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
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
# Set up the scheduler
echo 100 > $DIR/sched/interval
echo 1000 > $DIR/sched/interval2
@@
-104,11
+108,13
@@
if [ ! -d $__CONFDIR/$NAME ] ; then
echo 50 > $DIR/sched/tokens-min
echo 100 > $DIR/sched/tokens-max
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 `$_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
# Set up sysctl variables
echo net.ipv4.ip_forward > $DIR/sysctl/0/setting