to create ~/ on non RH distros.
[util-vserver-pl.git] / scripts / vuseradd
index 0e2c8a0..ba5c9cf 100755 (executable)
@@ -88,7 +88,7 @@ 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
@@ -156,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" ] && \