#!/bin/sh # # init script for SE3510 proxy software required by ESM AA # install this file as /etc/init.d/se3510_proxy and link as below # # ln -s /etc/init.d/se3510_proxy /etc/rc3.d/S98se3510proxy # ln -s /etc/init.d/se3510_proxy /etc/rc2.d/K98se3510proxy # BASEDIR_3x10A=`pkgparam SUNW3x10a BASEDIR 2>/dev/null` . ${BASEDIR_3x10A}/SUNW3x10a/bin/init.sh slpdrunning= proxyrunning= wbemexist= wbemname="Solaris WBEM Services" proxyname="3510 SMI-S Provider" pgrep slpd > /dev/null 2>&1 if [ $? -eq 0 ] ; then slpdrunning=1 fi pgrep -f 'java .*/lib/wbemstartup\.' > /dev/null 2>&1 if [ $? -eq 0 ] ; then proxyrunning=1 else # in some system, the java path is very long, so the wbemstartup # will not been showed in ps, so we must using other way to do so. if [ -f ${CIMMON_PID_FILE} ]; then CIMOM_PID=`head -1 ${CIMMON_PID_FILE}` # notice: the ps -eaf -o pid,args only supported and tested in Solaris sparc. PID=`ps -eaf -o pid,args | grep java | awk '{print $1}' | grep -v grep | grep $CIMOM_PID` if [ "$PID" = "$CIMOM_PID" ]; then proxyrunning=1 fi fi fi if [ -f /etc/rc2.d/S90wbem ] ; then wbemexist=1 fi case "$1" in start) if [ $slpdrunning ] ; then echo "OpenSLP is already running." else echo "Starting OpenSLP for the $proxyname." $WBEM_HOME/bin/slpd > /dev/null 2>&1 fi if [ $proxyrunning ] ; then echo "The $proxyname is already running." else echo "Starting $proxyname." # get the port to file before start server if [ -f ${PATH_3x10A}/config.sh ]; then . ${PATH_3x10A}/config.sh if [ "X$HTTPPort" != "X" ]; then # we need create file. echo "HTTPPort=$HTTPPort" >${PATH_WSIJWS_BIN}/cimxmlcpa.properties if [ "X$HTTPPort" = "X5988" ]; then # show the message only HTTPPort is 5988 if [ $wbemexist ] ; then echo >&2 "Error:" \ "$wbemname (S90wbem) is configured to start at boot time." echo >&2 "It must be disabled or" \ "the $proxyname will not function correctly." fi fi fi if [ "X$HTTPSPort" != "X" ]; then # we need create file. echo "HTTPSPort=$HTTPSPort" >${PATH_WSIJWS_BIN}/cimxmlscpa.properties fi if [ "X$RMIPort" != "X" ]; then # we need create file. echo "RMIPort=$RMIPort" >${PATH_WSIJWS_BIN}/cimrmicpa.properties fi fi $PATH_WSIJWS/bin/start_server > /dev/null 2>&1 fi ;; stop) if [ $slpdrunning ] ; then echo "Stopping OpenSLP." pkill -9 slpd else echo "OpenSLP is not running." fi if [ $proxyrunning ] ; then echo "Stopping $proxyname." # if you want using stop_server, you may need using -s option $PATH_WSIJWS/bin/kill_server > /dev/null 2>&1 else echo "The $proxyname is not running." fi ;; status) if [ $slpdrunning ] ; then echo "OpenSLP is running." else echo "OpenSLP is not running." fi if [ $proxyrunning ] ; then echo "The $proxyname is running." else echo "The $proxyname is not running." fi ;; *) echo "Usage: $0 {start|stop|status}" exit 1 ;; esac exit 0