[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple processes started when explicit start commands areused on d
Re: Multiple processes started when explicit start commands areused on dependant processes.
Thu, 9 Feb 2006 00:13:08 +0100
You are perfectly right, there is NO GENERAL WAY to determine
service is ready or not.
That's why it has to be done in the specific start script for that
(I tried to find an explicit statement to this respect in the Linux
I still believe it means this :
Only after the start script has terminated you can be sure the
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 :)=
Mobil +47 97141255