monit-general
[Top][All Lists]
Advanced

[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: Tue, 7 Feb 2006 22:17:43 +0100


On 7. feb. 2006, at 19.43, Philipp Berndt wrote:

On Thursday 02 February 2006 15:05, Jan-Henrik Haukeland wrote:
On 30. jan. 2006, at 20.14, P Holdaway wrote:
Conceptually, does the code make an effort to block other start/ stop
process commands while the start/stop of a dependency tree is
executing?

For start it does not wait, for stop it waits. You can examine
control.c to see how this is handled.

What sense does it make to run several start scripts concurrently?

Not concurrently but sequential, that is, sequential forks :) But I agree, it would be much better for monit to wait on each process it starts in a depend tree.

Note that checking for the process id is *NOT* enough, because the service may
have to initialize (spawn other processes, claim resources etc.).

This is exactly the problem, waiting for a process or pid file to be written is not enough, since this is typically done at the start and before other initializing tasks. So what should we wait for? If you have a good _general_ suggestion I'm all ears.

If it's a socket based server, such as apache or mysql, we could wait for it to pass a connection w/protocol test. That should work since we then now it is initialized and the processing machinery works. However this is not the case for many servers started by monit and hence not general.

Only after the start script has terminated you can be sure the service is
ready and may be used by dependant services.

Nope, if the start script calls 'exec' it will never return or if it just does a fork ala 'program&' we are still back to the problem situation described above.

Besides, even running non-dependant start-scripts in parallel probably just
complicates things, muddles logging

For monit's part, logging is synchronized and so is the code. The problem is to find a good condition for saying that a server is up and running. Preferably a condition that can be expressed in C. The "best" we can do is probably to wait for a pid file to be written after all, and monit should check for the existence of a process pid file before it starts the next process in a dependency graph. Patch is welcome :)

--
Jan-Henrik Haukeland
Mobil +47 97141255





reply via email to

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