#!/bin/bash ### # chkconfig: 35 90 10 # Description: Start the Weblogic Node Manager ### # Standard functions . /etc/init.d/functions # Init . /etc/init.d/initFmwNodeManager ############################################################################### # restart ############################################################################### restart(){ stop sleep 20 start } ############################################################################### # status ############################################################################### status(){ PCOUNT=`ps -ef | grep "NodeManager" | grep "$FMW_HOME" | grep -v grep | grep -v start | wc -l` if [ "$PCOUNT" -eq 0 ] then echo "Service is not running" else echo "Service is running in `echo $PCOUNT` processes" fi } ############################################################################### # start ############################################################################### start(){ echo "Launching NodeManager" if [ "$USER" != "$WL_OWNER" ] then su - $WL_OWNER -c "nohup $WL_HOME/server/bin/startNodeManager.sh > /tmp/nohup.out &" else nohup $WL_HOME/server/bin/startNodeManager.sh > /tmp/nohup.out & fi } ############################################################################### # stop ############################################################################### stop(){ PID=`ps -ef | grep "NodeManager" | grep "$FMW_HOME" | grep -v grep | grep -v start | cut -c 10-14` if [ "$PID" != "" ] then echo "Stopping NodeManager" kill -15 $PID else echo "NodeManager not running" fi } ############################################################################### # main ############################################################################### case "$1" in start) start ;; stop) stop ;; status) status ;; restart) restart ;; *) echo $"Usage: $0 {start|stop|status|restart}" RETVAL=1 esac exit $RETVAL