#!/sbin/sh -
# $Id: vxvm-recover.sh,v 1.6.45.3 2003/03/19 22:45:53 girish Exp $
#ident "$Source: /project/unixvm-cvs/src/sol/cmd/vxvm/init.d/vxvm-recover.sh,v $"

# Copyright (c) 2001 VERITAS Software Corporation.  ALL RIGHTS RESERVED.
# UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT
# LAWS OF THE UNITED STATES.  USE OF A COPYRIGHT NOTICE
# IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
# OR DISCLOSURE.
# 
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND
# TRADE SECRETS OF VERITAS SOFTWARE.  USE, DISCLOSURE,
# OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
# EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
# 
#               RESTRICTED RIGHTS LEGEND
# USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT IS
# SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH
# (C) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND
# COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013.
#               VERITAS SOFTWARE
# 1600 PLYMOUTH STREET, MOUNTAIN VIEW, CA 94043

# attach plexes, as needed, and start the volume manager watch daemons.

PATH=/usr/lib/vxvm/bin:/sbin:/usr/sbin:/usr/bin

# do not start if the upgrade_start script was run and the upgrade_finish
# has not be run yet, because /etc/vx/slib does not have right libraries
# till the upgrade_finish is run

if [ -f /VXVM3.2-UPGRADE/.start_runed ]
then
	exit 0
fi

# if the volume manager hasn't yet been initialized, don't bother
# starting vold.  The install-db file indicates that initialization
# has NOT yet happened.

if [ -f "/etc/vx/reconfig.d/state.d/install-db" ]
then
	exit 0
fi

# attach stale plexes and recover plex synchronization.
# Don't start volumes.  Volumes should have been started out of the
# vol-startup script, which is run out of inittab early in the boot
# sequence.
vxrecover -b -o iosize=64k > /dev/null

# start the watch daemon.  This sends E-mail to the administrator when
# any problems are found.  To change the address used for sending problem
# reports, change the argument to vxrelocd.
vxrelocd root &

# to enable hot sparing instead of hot relocation.
# ( comment out vxrelocd before uncommenting vxspare )
 
#vxsparecheck root &

echo "Starting VxVM Diskgroup Configuration Log Daemon..."
vxconfigbackupd &

exit 0
