[Top][All Lists]

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

Re: Monitor multiple processes?

From: Jan-Henrik Haukeland
Subject: Re: Monitor multiple processes?
Date: Wed, 07 Apr 2004 09:27:09 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux)

"Jan Johansson" <address@hidden> writes:

> Is there any way to monitor multiple pids/processes (in my case
> four) and if _either_ of them fail, run a common script? Sure I
> could define four processes,

Since there is a 1:1 mapping between a process and a pidfile you will
need to specify 4 'check process' entries in the monitrc file.

What kind of program are your monitoring? It's seems strange that a
program forks off 4 independent processes and that you need to monitor
all of them. (Usually it's enough to monitor the parent process,
e.g. apache using a preforked model).

> but then I suppose I could risk a race condition if two of them
> failed simultaneously?

If this is the case you can utilize some simple synchronization
techniques in the stop/start script shared by the processes and called
by monit. Using a lock-file is probably the easiest.

Jan-Henrik Haukeland

reply via email to

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