You are perfectly right, there is NO GENERAL WAY to determine
whether the
service is ready or not.
That's why it has to be done in the specific start script for that
service.
(I tried to find an explicit statement to this respect in the Linux
Standard
*
I still believe it means this :
Only after the start script has terminated you can be sure the
service is
ready and may be used by dependant services.
Agree, however there are at least one problem with this. Monit may
not start a script, but a program. Users are free to put whatever
executable in the start and stop statements which may not return.
This can be fixed by adding, for instance, a [AND WAIT] optional part
to the start and stop statement, so it says
start program = "/etc/init.d/httpd start" and wait
If AND WAIT was specified, monit does, for instance, a waitpid(2) and
suspend itself until waitpid returns. (Some form of timeout is
required, so a badly written script does not hang monit forever).
This may possibly also be a better solution than the wait-for-pid
thread we use today in control.c for stopped processes.
Just my 0.02 Euro. If there are interest for such a solution and the
other commiters agree, we'll put it up on our TODO list and we'll
realize it whenever we have time, which may be a long time :)=
--
Jan-Henrik Haukeland
Mobil +47 97141255
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general