|
From: Leif M. <le...@ta...> - 2003-08-10 05:32:34
|
Chuck, This is actually a problem that I have been trying to figure out the best way of resolving. For system startup, and shutdown. You would do this by registering tomcat run levels to use a startup order that is lower than apache and a shutdown order that is lower than apache. I have docs on this for the Debian Linux platform. I need help from users to get similar pages setup for other Unix/Linux platforms. http://wrapper.tanukisoftware.org/doc/english/launch-nix-boot-debian.html The problem right now is that the sh and bash scripts as is work correctly at shutdown, in that they will wait until the wrapper has actually stopped before continuing, but at startup, they return almost immediately. This would lead to the the system moving on to start Apache before Tomcat is fully started. I view this as a bug and will look at fixing things so that the scripts will always wait until the Wrapper has started the application. This will involve a change to the Wrapper binary. Another problem is that both the WrapperSimpleApp and WrapperStartStopApp classes are designed to work with Applications whose main methods do not necessarily return. Because of this, neither of these classes are really capable of knowing when the Java application has actually started. This is a problem/issue on Windows as well. The third integration method, using the WrapperListener, does not have this problem, as your code tells the Wrapper when it has started by returning from the WrapperListener.start method. This issue is documented. I have been thinking of adding additional versions of the WrapperSimpleApp and WrapperStartStopApp classes which would require that the application's main method returned. This would allow an application to tell the Wrapper when it has started without having to implement the WrapperListener interface. Another problem is that on Windows, if you set up a dependency in the Apache service on Tomcat, then stopping Tomcat would also stop the Apache service automatically. Then starting the Apache service, would cause the Tomcat service to be started automatically. I am not currently aware of any such mechanism in Linux. That doesn't mean it doesn't exist. As much as I know about Linux, I have come to the conclusion that I will always be learning more :-) So in summary. To get this working for you at system startup and shutdown. You would have to use the WrapperListener method to integrate. And I will take a look at what is necessary to make the wrapper executable wait until the Java application is completely started before returning. Do you see any other issues that I need to keep in mind? The Jk2 connector runs as part of the Apache process doesn't it? Or is that yet another process? Cheers, Leif Chuck Simpson wrote: >I would like to use JSW to manage an Apache/Tomcat config. Tomcat and >Apache are configured to use the JK2 connector so that Apache is the >HTTP/HTTPS frontend and Tomcat is application server backend. There is a >dependency to start Tomcat before Apache, and likewise shutdown Apache >then Tomcat. > >I read the different integration methods and none seem to specifically >address this issue on a Linux/Unix platform. I could hack this into a >WrapperListener class using Runtime.exec to start Apache and >Runtime.addShutdownHook to stop Apache. Is this the recommended method >of handling service dependencies on Linux/Unix? > >Assuming the answer is yes, I still have to devise a means of end-to-end >monitoring to ensure that Apache and the JK2 connector are functioning >as well as the Tomcat JVM. I can script a pinger to do this, but how >would I integrate it with JSW's monitor? > >BTW, this is a great tool. I don't know how many times I have had to >script monitors to do similar things. Using JSW I should not have to do >so again. > >Thanks, >Chuck > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 >_______________________________________________ >Wrapper-user mailing list >Wra...@li... >https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > |