# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# SNDR start script
#
# Description: This is the SNDR start script. It must be located
# rc0.d files.
# It can also be used to start or stop a specified cluster
# resource group when invoked from the data service cluster
# failover script.
#
#
#
USAGE="Usage: $0 {start|stop} [cluster_resource]"
DSCFG_DEPEND_NOCHK="/tmp/.dscfgadm_pid"
# Make sure prior SMF dependents are not 'online'
# $1 = name of SMF service to validate dependents
#
{
times=0
count=1
then
return 0
elif [ -f $DSCFG_DEPEND_NOCHK ]
then
do
then
return 0
fi
done
then
return 0
fi
do
then
# Output banner after waiting first 5 seconds
#
then
echo "Waiting for $1 dependents to be 'offline'"
fi
# Has it been longer then 5 minutes? (60 * 5 secs.)
#
then
echo "Error: Failed waiting for $1 dependents to be 'offline'"
exit $SMF_EXIT_ERR_FATAL
fi
# Now sleep, giving other services time to stop
#
sleep 5
fi
done
return 0
}
}
case "$1" in
'start')
COPT=
if [ -x ${RDCBOOT} ]
then
if ${CLINFO}
then
if [ "$2" != "" ]
then
${RDCBOOT} -r -C $2
else
# SNDR 3.2 SetIDs fixup
COPT="-C -"
fi
else
# non-clustered start
${RDCBOOT} -r
fi
fi
;;
'stop')
COPT=
then
fi
if [ -x ${RDCBOOT} ]
then
if ${CLINFO}
then
if [ "$2" != "" ]
then
${RDCBOOT} -s -C $2
else
COPT="-C -"
echo "killing SNDR daemons"
fi
else
# non-clustered stop
${RDCBOOT} -s
echo "killing SNDR daemons"
fi
else
# no sndr boot command, kill daemon anyway
echo "killing SNDR daemons"
fi
;;
*)
echo $USAGE
exit 1
;;
esac
exit $SMF_EXIT_OK