LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-14-2012, 01:29 PM   #1
lmu9@yahoo.com
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
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
 
Old 12-14-2012, 01:55 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
OS?
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start/Stop/Status init scripts Rocket2DMn Solaris / OpenSolaris 2 10-17-2008 09:26 AM
start|stop multiple oracle databases in the same oracle server prozac Linux - Software 8 01-23-2007 03:01 AM
Problem to start and stop oracle from sles 9 thkreddy Linux - Software 1 12-10-2006 01:02 PM
Runlevel start/stop scripts vanalex Linux - General 0 01-27-2004 08:54 PM
Oracle 9i Start/Stop scripts vous Linux - Software 0 01-16-2004 01:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration