|
From: Chuck S. <ch...@co...> - 2003-08-10 17:55:08
|
On Sun, 2003-08-10 at 00:32, Leif Mortenson wrote: > 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. Leif, I do this on Redhat as well so system startup and shutdown are not really an issue for me. I am more concerned with restarts (manual or in response to a JVM hang). I can handle this in a WrapperListener. I asked in case I missed an easier or better way to do this. > > ... snip ... > > 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 :-) > I believe init is similar to what windows does, but at a lower level. You could probably mimic Windows' service behavior using a wrapper script or a custom /etc/initscript. However you generally use either /etc/rc or init to manage a process, but not both since init executes /etc/rc on bootup and shutdown. Using both rc.d scripts and an inittab respawn entry to control a process could be tricky to do correctly. This may be an avenue to explore. See the init/telinit, initscript and inittab man pages for more. > 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? The JK2 connector runs in the Apache process, but uses a named pipe to communicate with Tomcat. The named pipe can be deleted by a careless user or can hang due to errors in the OS which is why I need an end-to-end check from Apache -> Tomcat -> Apache. I can call wget on a URL to do this and call JSW restart, but I was curious if there is an API hook or a communication interface into the native wrapper. For example I use fifo files to communicate and control some of my applications. The application has a listener that blocks on the fifo read until it receives something and then creates a new thread to handle the action associated with the fifo input. You could also use sockets to do the same thing, but when both processes are on the same machine a fifo has some advantages such as the ability to queue up events while the target application is down. I appreciate the response and look forward to using JSW to get a better handle on my servers. Thanks, Chuck |