wait for mysql availability

Michael Gmelin freebsd at grem.de
Sat Jun 11 16:40:53 UTC 2016



> On 11 Jun 2016, at 08:11, Mathieu Arnold <mat at FreeBSD.org> wrote:
> 
> 
> 
> +--On 11 juin 2016 13:48:52 +0300 abi <abi at abinet.ru> wrote:
> | Hello,
> | 
> | 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 mysql server should be ready to use after its rc script returns, you
> should open a PR with mysql for this to be fixed.
> 
> 

There's a difference between starting MySQL and it becoming available to clients, e.g. when innodb is recovering from a crash, which can take a long time and is not necessarily something you want to wait for on boot.

- m




More information about the freebsd-ports mailing list