wait for mysql availability

Kurt Jaeger lists at opsec.eu
Sat Jun 11 10:54:03 UTC 2016


Hi!

> I have a daemon depended on mysql database, however
> REQUIRE: mysql
> is not enough as mysql databases are not available immediately after 
> mysql start, so my daemon fails to start.
> 
> Are there any way to check mysql availability that would by mysql setup 
> agnostic?
> 
> I have 2 ideas: use sleep() or standalone script using application 
> credentials in prestart.

The second one is much better. The daemon should retry anyway if
the mysql connection is not available. Otherwise, how does it
cope if the mysql database is restarted ?

-- 
pi at opsec.eu            +49 171 3101372                         4 years to go !


More information about the freebsd-ports mailing list