#!/sbin/sh
#
#pragma ident	"@(#)initscsymon	1.10	01/08/28 SMI"
#
# Copyright (c) 1999-2001 by Sun Microsystems, Inc.
# All rights reserved.
#

# Start/stop scsymon cache daemon

SCSYMONBINDIR=/usr/cluster/lib/scsymon
SCBINDIR=/usr/cluster/bin

# disable SunMC by default;
# SUNWescom -- package with common SunMC components

STARTSCSYMON=0
SUNMCAGENTSTART=/etc/init.d/init.es_agent

case "$1" in
'start')
        # test whether we are a cluster and exit if not a cluster
        /usr/sbin/clinfo > /dev/null 2>&1
        if [ $? != 0 ] ; then
                exit 0
        fi

	/usr/bin/pkginfo -qi SUNWescom
	if [ $? -eq 0  -o  -f $SUNMCAGENTSTART ]; then
	  STARTSCSYMON=1	
	fi
	
	if [ -f $SCSYMONBINDIR/scsymon_srv -a  $STARTSCSYMON -eq 1 ] ; then
		$SCBINDIR/pmfadm -c scsymon -n 3 $SCSYMONBINDIR/scsymon_srv
	fi

	;;

'stop')
	$SCBINDIR/pmfadm -s scsymon 9

	;;

*)

	;;

esac

exit 0

