X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvuseradd;h=ba5c9cfcf2d3e52cf13173becd72e316ee0be020;hb=c4de7f5b21fc299cc0462626fb1bfb5c33af5481;hp=2c9dfb33374e3cdf9f3c65813c2ff7cc496e21ee;hpb=2f48c024c10366ed48cb6ab3bbfa35081f8d1242;p=util-vserver-pl.git diff --git a/scripts/vuseradd b/scripts/vuseradd index 2c9dfb3..ba5c9cf 100755 --- a/scripts/vuseradd +++ b/scripts/vuseradd @@ -88,16 +88,16 @@ if [ ! -d $__CONFDIR/$NAME ] ; then fi mkdir -p $DIR/apps/init $DIR/rlimits $DIR/sched $DIR/dlimits/0 echo default > $DIR/apps/init/mark - echo 1000 > $DIR/rlimits/nproc + echo 1000 > $DIR/rlimits/nproc.hard # Set persistent for the network context echo persistent > $DIR/nflags # Set up the scheduler - echo 1000 > $DIR/sched/interval + echo 100 > $DIR/sched/interval echo 1000 > $DIR/sched/interval2 echo 0 > $DIR/sched/fill-rate - echo 32 > $DIR/sched/fill-rate2 + echo 1 > $DIR/sched/fill-rate2 touch $DIR/sched/idle-time echo 100 > $DIR/sched/tokens echo 50 > $DIR/sched/tokens-min @@ -109,6 +109,9 @@ if [ ! -d $__CONFDIR/$NAME ] ; then echo -1 > $DIR/dlimits/0/inodes_total echo -1 > $DIR/dlimits/0/space_total + # Disable mount namespaces + touch $DIR/nonamespace + # Remove the basically empty guest directory rm -rf $__DEFAULT_VSERVERDIR/$NAME # Move the guest back @@ -153,8 +156,11 @@ if [ -d "$__DEFAULT_VSERVERDIR/$NAME" ] ; then chmod 755 "$__DEFAULT_VSERVERDIR/$NAME" # Add user in vserver - $_VSERVER ----insecure $NAME suexec root sh -c \ - "groupadd -g $GROUPID $GROUPNAME ; useradd -u $USERID -g $GROUPID -p '' $NAME" + $_VSERVER $NAME start --rescue sh -c \ + "groupadd -g $GROUPID $GROUPNAME ; useradd -m -u $USERID -g $GROUPID -p '' $NAME" + + # Stop the guest (since it's persistent) + $_VSERVER $NAME stop # Add an unrestricted entry to /etc/sudoers file if [ -f "$__DEFAULT_VSERVERDIR/$NAME/etc/sudoers" ] && \