fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#!/bin/sh
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Second SNDR start script
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# - called after the TCP/IP stack has been initialised,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# and networking enabled.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# - should be linked to /etc/rc2.d/S72rdcfinish as follows:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# ln /etc/init.d/rdc /etc/rc2.d/S72rdcfinish
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePATH=/etc:/bin
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteRDCD="/usr/lib/sndrd"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteRDCSYNCD="/usr/lib/sndrsyncd"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteUSAGE="Usage: $0 start"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte. /lib/svc/share/smf_include.sh
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecase "$1" in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte'start')
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "Completing SNDR startup:\c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ##
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ## Start sndrd
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ##
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ ! -f ${RDCD} ]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "Cannot find ${RDCD}.\nSNDR services unavailable." > /dev/console
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte exit $SMF_EXIT_MON_OFFLINE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ps -e | grep sndrd > /dev/null 2>&1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ $? -ne 0 ]; then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ${RDCD}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo " sndrd\c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo " sndrd already enabled\c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ##
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ## Start sndrsyncd
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ##
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ ! -f ${RDCSYNCD} ]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "\nCannot find ${RDCSYNCD}.\nSNDR start aborted." > /dev/console
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte exit $SMF_EXIT_MON_OFFLINE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ps -e | grep sndrsyn > /dev/null 2>&1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ $? -ne 0 ]; then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ${RDCSYNCD}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo " sndrsyncd\c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo " sndrsyncd already running\c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo " done"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ;;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte'stop')
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # Inserted for symmetry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ;;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte*)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo $USAGE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte exit 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ;;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteesac
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteexit $SMF_EXIT_OK