Start Stop scripts for oracle weblogic server
OS is OEL Linux 5.5
Weblogic version 12.1
Oracle Database version 10.2 (yes, it needs upgrading)
Oracle Weblogic server has several parts to start. I am currently sleeping between each script to start these different parts. Weblogic server, nodemanager and managed servers. I would instead like to check the script that is starting a service for the line "The server started in RUNNING mode" then continue on to run the next script. Sometimes the server doesn't start in running mode but in admin mode. I'd like to get a message when this happens.
The scripts have to run with the output going to a screen. Contractors have started the services in multiple VNC sessions for lack of experience I supposed. What a pain that is to manage. The services run fine if you nohup the script send the output to a file.
here is the script to start it. This is for Apex but it is the same concept if it is OBIEE or Discoverer or any other Fusion Middleware using Weblogic
Source env.
export MW_HOME=/u01/dev/apex/Middleware
export WL_HOME=$MW_HOME/wlserver_12.1
export DOMAIN_HOME=$MW_HOME/user_projects/domains/ApexDomain
PATH=$WL_HOME/server/bin:$DOMAIN_HOME/bin:$PATH; export PATH
The start script:
echo "Starting WebLogic Server ......"
nohup sh $DOMAIN_HOME/bin/startWebLogic.sh > /home/apexadmin/bin/log/wls_start.log &
sleep 150
echo "Starting Node Manager ......"
unset JAVA_OPTIONS
nohup sh $WL_HOME/server/bin/startNodeManager.sh > /home/apexadmin/bin/log/startNodeManager.log &
sleep 10
I tried adding this instead of the sleep but it doesn't do anything, just hangs.
tail -f /home//bin/log/wls_start.log | while read LOGLINE | tee /dev/tty
do
[[ "${LOGLINE}" == *"The server started in RUNNING mode"* ]] && pkill -P $$ tail
done
This is the output running with -x. It doesn't send the output to the console and it doesn't ever find the text in the log I am looking for, nor does it end
[apexadmin@box bin]$ sh -x start.sh
+ echo 'Starting WebLogic Server ......'
Starting WebLogic Server ......
+ nohup sh /u01/dev/apex/Middleware/user_projects/domains/ApexDomain/bin/startWebLogic.sh
+ tail -f /home/apexadmin/bin/log/wls_start.log
+ read LOGLINE
+ tee /dev/tty
+ [[ '' == *\T\h\e\ \s\e\r\v\e\r\ \s\t\a\r\t\e\d\ \i\n\ \R\U\N\N\I\N\G\ \m\o\d\e* ]]
+ read LOGLINE
+ tee /dev/tty
Last edited by lmu9@yahoo.com; 12-14-2012 at 03:00 PM.
Reason: run scripts with sh -x output
|