|
From: Ori A. <ori...@ap...> - 2003-10-20 17:03:05
|
Hi, I have a shutdown class that needs to be called when stopping the daemon, and the way the sh script looks, it just kills the java process without calling it. Is this true? I don't see the shutdown class being activated in the logs. (As NT service on windows it works fine) Should I just enter a call to another shutdown sh there? That seems like ignoring the conf file and going back to scripts, which feels wrong. Ori |
|
From: Leif M. <le...@ta...> - 2003-10-21 16:55:25
|
Ori, This is a new name to me. :-) Where are you from? > I have a shutdown class that needs to be called when stopping the > daemon, and the way the sh script looks, it just kills the java > process without calling it. Is this true? I don't see the shutdown > class being activated in the logs… > The sh script that comes with the Wrapper stop the Wrapper by sending it a HALT signal. The Wrapper traps this and other signals and attempts to shutdown the JVM cleanly. Depending on the integration method that you used different things will happen. If you are using Integration Method 1 (WrapperSimpleApp) then the JVM will be shutdown with a call to System.exit. In order for your shutdown class to be run in this case, your application will have to register its own shutdown hook. See the java.lang.Runtime class for details on registering a shutdown hook. NOTE - What JVM version are you using? Shutdown hooks were adding Java 1.3. Older versions will simple exit with Integration method 1. Integration Method 2 (WrapperStartStopApp) allows you to specify a shutdown class whose main method will be called on shutdown. This method works with all Java versions. Integration Method 3 (WrapperListener) is more involved and requires that you implement the WrapperListener interface yourself. In this method, your application knows when the JVM is being shutdown because the listeners stop method is called. This also works with all Java versions. Hope this helps. Let me know if you have more questions. > (As NT service on windows it works fine) > Strange. If it works on NT, it should also be working on *NIX with the same wrapper.conf file. If you are not able to get it working, please post your wrapper.conf file and the contents of your wrapper.log file for a SINGLE Wrapper invocation. Add the wrapper.debug=true property to the conf file before creating the log output it is very informative. > Should I just enter a call to another shutdown sh there? That seems > like ignoring the conf file and going back to scripts, which feels wrong. > You should not need to be doing that. The existing scripts should do everything you need. Lets get them working for you. Cheers Leif |
|
From: Ori A. <ori...@ap...> - 2003-10-22 11:27:09
|
Leif, Thanks for the reply. The name Ori is Israeli, which is where I'm from. <regarding integration methods> Ok, the app I'm trying to run as daemon\service is BEA Weblogic 6.1\7.0. This seemed perfect for integration method 2 (start\stop) but as far as I tested with WL6.1 the app server rejects the connection from the stop class with something that appears to be a security issue. I don't remember all the details but since I needed other advanced features as well (requesting delay on startup until server is "logically up") I wrote my own implementation - so we are in integration method 3. <JVM> BEA use their own JVM not Sun's, but I think the version is 1.3.1 and I think we have shutdown hooks (Ctrl-C terminates the app in console mode on NT). <NT VS Linux> The same conf file is used. Compare the different logs after the line: ======== server is up ======== The NT shows the shutdown class being called, while on the Linux the process just terminates. Thanks, Ori -----Original Message----- From: wra...@li... [mailto:wra...@li...] On Behalf Of Leif Mortenson Sent: Tuesday, October 21, 2003 09:55 To: wra...@li... Subject: Re: [Wrapper-user] running shutdown class when stopping linux daemon Ori, This is a new name to me. :-) Where are you from? > I have a shutdown class that needs to be called when stopping the > daemon, and the way the sh script looks, it just kills the java > process without calling it. Is this true? I don't see the shutdown > class being activated in the logs. > The sh script that comes with the Wrapper stop the Wrapper by sending it a HALT signal. The Wrapper traps this and other signals and attempts to shutdown the JVM cleanly. Depending on the integration method that you used different things will happen. If you are using Integration Method 1 (WrapperSimpleApp) then the JVM will be shutdown with a call to System.exit. In order for your shutdown class to be run in this case, your application will have to register its own shutdown hook. See the java.lang.Runtime class for details on registering a shutdown hook. NOTE - What JVM version are you using? Shutdown hooks were adding Java 1.3. Older versions will simple exit with Integration method 1. Integration Method 2 (WrapperStartStopApp) allows you to specify a shutdown class whose main method will be called on shutdown. This method works with all Java versions. Integration Method 3 (WrapperListener) is more involved and requires that you implement the WrapperListener interface yourself. In this method, your application knows when the JVM is being shutdown because the listeners stop method is called. This also works with all Java versions. Hope this helps. Let me know if you have more questions. > (As NT service on windows it works fine) > Strange. If it works on NT, it should also be working on *NIX with the same wrapper.conf file. If you are not able to get it working, please post your wrapper.conf file and the contents of your wrapper.log file for a SINGLE Wrapper invocation. Add the wrapper.debug=true property to the conf file before creating the log output it is very informative. > Should I just enter a call to another shutdown sh there? That seems > like ignoring the conf file and going back to scripts, which feels wrong. > You should not need to be doing that. The existing scripts should do everything you need. Lets get them working for you. Cheers Leif ------------------------------------------------------- This SF.net email is sponsored by OSDN developer relations Here's your chance to show off your extensive product knowledge We want to know what you know. Tell us and you have a chance to win $100 http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54 _______________________________________________ Wrapper-user mailing list Wra...@li... https://lists.sourceforge.net/lists/listinfo/wrapper-user |