Autor: Simon Hobson Data: Para: dng@lists.dyne.org Assunto: Re: [DNG] tiny service state api [WAS: Fwd: init system agnosticism]
"Enrico Weigelt, metux IT consult" <enrico.weigelt@???> wrote:
>> For those of us who put consistency above boot speed, simply changing
>> the init script so MySQL doesn't flag as "started" until the daemon
>> is up and ready to accept requests would fix it;
>
> But then you'll have kind of daemon who watches mysql until it's really
> ready and then signals back to the service monitor, so it can proceed
> with the other services. In the long run, sounds like a maintenance
> hell to me.
Which is why I said I can see some value in a simple communication/notification system. Ideally you'd have MySQL itself make status calls along the lines of "I'm starting but not ready" and hopefully end with "I'm now ready for business". The latter would then allow other processes that depend on a working database to continue.
At present, IIRC the script starts the MySQL process, then loops round waiting for <something> to appear - at which point it assumes MySQL is ready for action and prints OK on the console.
That way, there's a standard way for processes to communicate their status, and a simple and standard way for dependent processes to determine if something they need is ready yet.