X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvuserdel;h=ba742736ecc84eccfc34d50bf78170bec6c0361f;hb=9a08c0c31d74249eec1a5e5346e1457366200df7;hp=778a0faa876401cf1a962e00d48c04d77054e070;hpb=73929cd988b29cc673ff12945fc921957bd3ce78;p=util-vserver-pl.git diff --git a/scripts/vuserdel b/scripts/vuserdel index 778a0fa..ba74273 100755 --- a/scripts/vuserdel +++ b/scripts/vuserdel @@ -4,7 +4,7 @@ # # Copyright (c) 2004 The Trustees of Princeton University (Trustees). # -# $Id: vuserdel,v 1.11 2007/06/29 14:13:01 dhozac Exp $ +# $Id$ # : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} @@ -24,34 +24,7 @@ usage() [ "$1" == "--static" ] && { STATIC=yes; shift; } NAME=$1 -# read config file to get context ID -CTX=`cat $__CONFDIR/$NAME/context` - -# don't bother stopping gracefully, just kill all the processes -chcontext --silent --secure --ctx $CTX $__LEGACYDIR/vserverkillall - -# unmount any directories in vserver that are mount points -for d in `sed -ne "s%^[^ ]* \($__DEFAULT_VSERVERDIR/$NAME/[^ ]*\) .*%\1%p" /proc/mounts` -do - # use echo -e to turn escaped whitespace back into regular chars - # be careful about embedded backquotes here (i think we're safe) - dir=`echo -e "$d"` - echo "unmounting $dir" - umount -l "$dir" -done - # delete user [ -z "$STATIC" ] && userdel -r $NAME -# remove vserver configuration directory -rm -rf /etc/vservers/$NAME - -# remove vserver profile -rm -f /var/run/vservers/$NAME.ctx - -# destroy vserver -if [ -d $__DEFAULT_VSERVERDIR/$NAME ] ; then - TMP=$(mktemp -d "$__DEFAULT_VSERVERDIR/.vtmp/$NAME.XXXXXX") - mv "$__DEFAULT_VSERVERDIR/$NAME" "$TMP" - rm -rf "$TMP" -fi +vserver --silent $NAME delete > /dev/null 2> /dev/null