3 # vzgot This shell script takes care of starting and stopping
4 # vzgot container with the "ON" status
6 # description: Scan vzgot vdir directory to find out about container
7 # and start them if requested.
10 # description: Startup/shutdown vzgot containers
13 # Required-Start: network
17 # Short-Description: starting container
22 [ -f /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions
24 if [ -f /etc/vzgot/vzgot_config ] ; then
25 . /etc/vzgot/vzgot_config
28 #------------------------------------------------------------------
32 echo -n "Vzgot starting" && success || failure
35 for cont in `ls $VZLIB/vzdir`
37 if ! [ -f $VZLIB/vzdir/status ] ; then
38 . $VZLIB/vzdir/$cont/status
42 if ! [ -f $VZLIB/vzdir/$cont/first.pid ] ; then
43 BOOTLOG=$VZLIB/vzdir/$cont/bootlog
45 echo -n "Booting container $cont"
46 vzgot boot $cont && success || failure
48 count=`expr $count + 1`
56 echo -n "vzgot: $count container started" && success || failure
63 echo -n "Vzgot stopping" && success || failure
65 for cont in `ls $VZLIB/vzdir`
67 if [ -f $VZLIB/vzdir/$cont/first.pid ] ; then
68 echo -n "Halting container $cont"
69 vzgot shutdown $cont && success || failure
71 while [ -f /$VZLIB/vzdir/$cont/first.pid ] ; do
76 echo -n "vzgot: all container now down" && success || failure
80 #------------------------------------------------------------------
84 touch /var/lock/subsys/vzgot
92 rm -f /var/lock/subsys/vzgot
108 echo "Usage: regulus {start|stop|restart|status}"