#! /bin/sh #---------------------------------------------------- #shell used to clean the host part (network, cgroup) #while stopping a vzgot Virtual Host #This shell is called from the vzgot executable # #---------------------------------------------------- #Syntaxe #vzgot.open VE_name VE_pid [base_dir] # VE_name is the container dir name # VE_pid is the container main process ID as seen # by the host # base_dir is this application root directory # used for devel only. #---------------------------------------------------- CONTNAME=$1 VEPID=$2 BASE=$3 #---------------------------------------------------- if ! [ -f $BASE/etc/vzgot/vzgot_config ] ; then echo "Missing vzgot config file" exit 1 #trouble trouble fi . $BASE/etc/vzgot/vzgot_config #specific container configuration override (if needed) if [ -f $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config ] ; then $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config fi #---------------------------------------------------- #lets cancel all routing $BASE/$VZLIB/shell/vzgot.net $CONTNAME remove $BASE #---------------------------------------------------- #Using cgroup if available and operational if [ -f $CGROUP/tasks ] ; then rm -fr $BASE/$VZLIB/vzdir/$CONTNAME/cgroup rmdir $CGROUP/$VEPID fi exit 0