Tuesday, February 25, 2014

Weblogic Start Admin Server and managed Server on Reboot



#!/bin/bash
#
# oracle Init file for starting and stopping WLS
# Created by Vivek Jain
# chkconfig: 35 80 30
# description: Oracle WLS startup script
# Source function library
# chmod 755 /etc/init.d/wls
# chkconfig --add wls --level 0356
# nodemanager properties CrashRecoveryEnabled=true,StartScriptEnabled=true


. /etc/rc.d/init.d/functions

ORACLE_OWNER="oracle"
MW_HOME="/u01/app/Oracle/Middleware"
DOMAIN_HOME="/u01/app/Oracle/Middleware/user_projects/domains/E1_HTTP_PD"

case "$1" in
start)
echo -n $"Starting WLS:"
su - $ORACLE_OWNER -c "nohup /u01/JDE_HOME/SCFHA/bin/startAgent > /dev/null &"
su - $ORACLE_OWNER -c "nohup $MW_HOME/wlserver_10.3/server/bin/startNodeManager.sh > $MW_HOME/wlserver_10.3/common/nodemanager/nodemanager.out 2>&1 &"
su - $ORACLE_OWNER -c "nohup $DOMAIN_HOME/bin/startWebLogic.sh > $DOMAIN_HOME/servers/AdminServer/logs/AdminServer.out 2>&1 &"
echo "OK"
;;
stop)
echo -n $"Stopping WLS:"
su - $ORACLE_OWNER -c "nohup $DOMAIN_HOME/bin/stopWebLogic.sh > $DOMAIN_HOME/servers/AdminServer/logs/AdminServer.out 2>&1 &"
ps -ef | grep NodeManager | grep -v grep | awk '{system("kill -9 "$2)}'
su - $ORACLE_OWNER -c "nohup /u01/JDE_HOME/SCFHA/bin/stopAgent > /dev/null &"
echo "OK"
;;
restart)
echo -n $"Re-Starting WLS:"
stop
sleep 3
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
esac

1 comment: