tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Walker Chris <>
Subject Apache/Tomcat/MySQL Startup Sequence on Linux
Date Mon, 15 Sep 2003 09:38:44 GMT

I'm having problems coordinating the startup scripts for Apache, Tomcat
(connected via mod_webapp) and MySQL.  The situation seems to be this:

- mod_webapp requires Tomcat to be already running when httpd starts

- the Tomcat application contains a connection pool that requires MySQL to
be running when Tomcat starts (this is a crap architecture, but I havn't
time to change it)

I can execute the startup scripts manually in the sequence
MySQL/Tomcat/Apache, and everything is fine.  But when they are executed at
system boot it doesn't work.  The httpd log contains a "web application not
found" message, and pages from the application are not available.

I've renamed the startup scripts so that the sequence is correct, but it
still doesn't work.  My guess is that most of the Tomcat startup forks, so
that the httpd startup is invoked before it has completed.

I can think of two very klugey workarounds: 

- call httpd restart at the end of the Tomcat startup - what will this do if
the "real" httpd script is still executing?

- make the httpd script sleep for a while before it does anything - but
there's no way to guarantee it will sleep long enough

Alternatively I could add code to the httpd script to see if Tomcat has
completed its startup.  But I don't know for sure how I would tell, and I'd
rather avoid this sort of hack if there's a proper way to do it.

Chris Walker

View raw message