# DBMail tries to start before MySQL



## ph0enix (May 4, 2009)

I'm experimenting with DBMail and it's logging errors because it tries to start before the MySQL server is up.  Is there a way to tell it to wait until MySQL is up before executing the dbmail rc scripts.  

I tried adding:

REQUIRE: DAEMON mysql

...to the rc scripts but that's not doing the trick.  

Thanks! 

J.


----------



## phoenix (May 4, 2009)

Check the output of
`# rcorder /etc/rc.d/* /usr/local/etc/rc.d/*`

to see where MySQL and DBMail are listed.  Then look at things further down the list.  As a workaround, you can try adding items that are further down the list to the REQUIREL: line for DBMail, so that it will be re-ordered to start after them.

If that works, then you'll want to send a note to the DBMail port maintainer that he needs to find a way to make DBMail wait a bit longer before trying to access MySQL.


----------



## ernie (Oct 7, 2009)

I just had the same problem, even after checking that the DBmail programs  were starting after MySQL, they core dump as MySQL is not ready. I did a work around by putting  sleep 10 into each of the dbmail startup scripts. Had the same problem once with the apache mysql_auth module installed. MySQL is just too slow at starting up. Perhaps it's that mysqld_safe thing starting up?


----------

