Inserting VZGOT development tree within GIT
[safe/jmp/vzgot] / shell / vzgot.start
1 #! /bin/sh
2 #----------------------------------------------------
3 #shell used to initiate container, this script
4 #is called by the container BEFORE all the
5 #pivot root action.
6 #
7 #----------------------------------------------------
8 #Syntaxe
9 #vzgot.start VE_name VE_pid [base_dir]
10 #       VE_name is the container dir name
11 #       VE_pid is the container main process ID as seen
12 #       by the host
13 #       base_dir is this application root directory
14 #       used for devel only.
15 #----------------------------------------------------
16 CONTNAME=$1
17 VEPID=$2
18 BASE=$3
19 #----------------------------------------------------
20 if ! [ -f $BASE/etc/vzgot/vzgot_config ] ; then
21   echo "Missing vzgot config file"
22   exit 1        #trouble trouble
23   fi
24 . $BASE/etc/vzgot/vzgot_config
25
26 #specific container configuration override (if needed)
27 if [ -f $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config ] ; then
28   $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config
29   fi
30 #----------------------------------------------------
31 #renaming VETH pair to a standard ETH name
32 ip link set From_$2 name $ETHNAME
33 ret=$?
34 if [ $ret -ne 0 ]; then
35   echo "vzgot.container.start, unable to rename veth From_$2 to $ETHNAME"
36   exit $ret
37   fi
38 #----------------------------------------------------
39 #setting the fastboot flag
40 rm -fr $BASE/$VZLIB/vzdir/$CONTNAME/rootfs/.autofsck
41 touch $BASE/$VZLIB/vzdir/$CONTNAME/rootfs/fastboot
42 #----------------------------------------------------
43 exit 0