Solved

How to launch a script when starting an Oracle Application Server container?

Posted on 2006-10-27
6
376 Views
Last Modified: 2013-12-01
We have added a JMS componant to our growing application and now whenever one of our OAS containers goes down there are a couple of .lock files that are left behind in our ....../j2ee/<containername>/persistence/ subfolders.

Then once we attempt to bring the container up it pukes on these lock files. It was suggested that we use a script of some sort to delete *.lock files in this folder upon container startup.

I am not seeing any obvious methods of doing that.

Yes we use simple .sh files for startup and shutdown, but we also use DCM off the command line and from ANT deployment scripts as well as going through the web front end for application server control. As such I am not sure where to deal with the problem being as there are multiple entry points where you can perform startups....
0
Comment
Question by:hooch604
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:bpeterse
ID: 17835151
Perhaps the best place to put it is in the shutdown script(s):

(This is Korn shell)
******************
sleep 15
if [[ -n `ls <your_path_to>/*lock` ]]
then
        for i in `ls -l <your_path_to>*lock|cut -c55-`
          do
                rm -f $i
          done
fi
********************
0
 

Author Comment

by:hooch604
ID: 17835625
Yes but as I mentioned there is more than one way to skin a cat in this case. We are building and testing our j2ee application and as such there are frequent shutdowns of the containers that do not come from the shutdown scripts. So ideally this could be done on startup...
0
 
LVL 6

Expert Comment

by:bpeterse
ID: 17836355
In unix - there's typically at least 3 ways to skin that cat, but it's your box.  You can put the script where you like.  
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:hooch604
ID: 17837683
Thanks you!
0
 
LVL 3

Accepted Solution

by:
rkogelhe earned 200 total points
ID: 17987658
You can configure start and stop event scripts in opmn. See the metalink note "274088.1 -How to use the pre-start and pre-stop event scripts with AS10g on UNIX"

https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=274088.1

The idea is that you can execute any script using the event-scripts tag in opmn.xml.

<event-scripts>
        <pre-start path="/home/ias9041/pre-start.sh"/>
       <pre-stop path="/home/ias9041/pre-stop.sh"/>
</event-scripts>
0
 

Author Comment

by:hooch604
ID: 18003494
ah most excellent, I will look into that, thank you. I expect this is stuff a fully qualified admin would know but we currently have a gap in our expertise over here.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now