Control services startup order

Hello,
I just installed a Java application using PosgreSQL and Tomcat 7.
So far so good but when the server start, Tomcat is started before PostgreSQL is fully initialized and the application fail to start. So I have to log and do

service tomcat7 restart

In rc.conf I have the correct order. PosgreSQl before and then Tomcat.
I'll tried to put some delay in the Tomcat startup script

Code:
eval "_tomcat_wait=\${${name}_wait:-'90'}"
without luck so far.
I looked to force_depend but it seems hard to use and I'm not sure it will solve the problem.
Which simple solution did I missed ?

PS : I don't see PostgreSQL start in console.log but it started ok when I log and test the status.
 
Found it :)
I was just starting to wonder how come something easy to do on Linux was hard to do on FreeBSD ;)
But it's simple.
Just have to add
Code:
# BEFORE: tomcat7
in the PostgreSQL startup script header and it's ok.

Then rcorder /etc/rc.d/* /usr/local/etc/rc.d/* | egrep 'tomcat|postgres' shows:
Code:
/usr/local/etc/rc.d/postgresql
/usr/local/etc/rc.d/tomcat7
 
Back
Top