Just an FYI: I utilized Will's wonderful instructions and now have Tomcat supervised by Daemontools. the 'svc' command even works for HUP'ing and such!
Ben Ricker On Fri, 2002-10-11 at 16:30, Will Hartung wrote: > From: "camccuk" <[EMAIL PROTECTED]> > Sent: Friday, October 11, 2002 8:08 AM > > > > Does anyone have any experience with using Dan Bernstein's daemontools to > > supervise Tomcat? I've had real trouble getting this to work with either > > startup.sh or catalina.sh but I'm putting this down to the fact that I'm > no > > genius with unix processes... > > I don't really understand what the issue is here, but I plead ignorance in > that I haven't worked with the DJB tools in a while. > > But, as I recall, the tools simply execute the program using the (by > default) 'run' script. When run exits, for whatever reason, the tools fire > it back up. > > Now the tomcat startup scripts fire the java process off in the background, > but as I recall there is an option to NOT do that, and simply have tomcat.sh > stay in the foreground. > > It seems to me that a few simple tweaks to tomcat.sh, linked to 'run' in the > "proper spot", and it should Just Work. > > Lemme look. > > "This man has a bad heart. Angina Pectoris, but we have the cure...Yes. Here > they are..." > > Yes, here it is, just start catalina.sh with the "run" option, and it > doesn't fork into the background. > > #!/bin/sh > # daemontools run script for Tomcat > cd /usr/local/java/jakarta-tomcat-4.0.4/bin > # start tomcat in the foreground, redirect stderr to stdout for logging. > exec ./catalina.sh run 2>&1 > > Copy or link this script to /services/tomcat/run, and it should fire right > up. Untested, but it should work. > > Multilog should work with this as well, as the 'run' option doesn't redirect > stdout or stderr, whereas the (default) 'start' option does. Since multilog > only listens to stdin, the script redirects stderr to stdout so it can be > captured as well. You need to setup the log directory properly, as mentioned > in DJBs faq. > > The key is to keep the java process in the foreground for the 'run' script. > supervise puts it in the background for you, so that's why the run script > doesn't need to. > > Regards, > > Will Hartung > ([EMAIL PROTECTED]) > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
