#! /bin/sh #---------------------------------------------------- #shell used to initiate container, this script #is called by the container BEFORE all the #pivot root action. # #---------------------------------------------------- #Syntaxe #vzgot.start 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 #---------------------------------------------------- #renaming VETH pair to a standard ETH name ip link set From_$2 name $ETHNAME ret=$? if [ $ret -ne 0 ]; then echo "vzgot.container.start, unable to rename veth From_$2 to $ETHNAME" exit $ret fi #---------------------------------------------------- #setting the fastboot flag rm -fr $BASE/$VZLIB/vzdir/$CONTNAME/rootfs/.autofsck touch $BASE/$VZLIB/vzdir/$CONTNAME/rootfs/fastboot #---------------------------------------------------- exit 0