#! /bin/sh #---------------------------------------------------- #shell used to prepare container struture, this script #is called by the vzgot before any root pivot action. #It is used on the firstboot to prepare all needed file. #or restructure container. # #---------------------------------------------------- #Syntaxe #vzgot.fistboot VE_name VE_pid Distrib domain node name ip_list [Base] # VE_name is the container dir name # Linux family (RedHat...) # Domain is the container domainname # Node is the container hostname # IP_LIST is an ip list (ip,ip1,ip2,..) used # to prepare container network # base_dir is this application root directory # (used for devel only). #---------------------------------------------------- CONTNAME=$1 FLINUX=$2 DOMAIN=$3 NODE=$4 LSTIP=$5 BASE=$6 #---------------------------------------------------- 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 #==================================================== #Main script #setting linux family in configuration file echo "$FLINUX" > $BASE/$VZLIB/vzdir/$CONTNAME/linux case "$FLINUX" in "RedHat" ) $BASE/$VZLIB/shell/vzgot.fboot.redhat \ $CONTNAME $NODE $DOMAIN $LSTIP $BASE ;; "Debian" ) $BASE/$VZLIB/shell/vzgot.fboot.debian \ $CONTNAME $NODE $DOMAIN $LSTIP $BASE ;; "*" ) /bin/echo "<"$FLINUX"> not yet an implemented linux family" exit 1; ;; esac #---------------------------------------------------- #setting the container status to "ON" #used by /etc/init.d/vzgot when hot is booting echo "BOOT=ON" > $BASE/$VZLIB/vzdir/$CONTNAME/status #---------------------------------------------------- exit 0