[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple processes started when explicit start commands areused on d

From: Jan-Henrik Haukeland
Subject: Re: Multiple processes started when explicit start commands areused on dependant processes.
Date: Thu, 9 Feb 2006 00:13:08 +0100

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]