monit-general
[Top][All Lists]
Advanced

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

Re:Can monit block/wait on start/stop exec at all? (Chris McKenzie


From: Chris McKenzie
Subject: Re:Can monit block/wait on start/stop exec at all? (Chris McKenzie
Date: Thu, 17 May 2007 16:57:48 -0400

Hey he's a good continuation question. If the stop/start calls are forked, what does monit do when I call it to restart a service? Does the stop call in that instance wait for completion before continuing?

Thanks.

- Chris

From: "Chris McKenzie" <address@hidden>
Reply-To: This is the general mailing list for monit <address@hidden>
To: address@hidden
Subject: Re:Can monit block/wait on start/stop exec at all? (Chris McKenzie
Date: Thu, 17 May 2007 13:38:12 -0400

Its not horribly wrong, monit forks the program call and only notes if the forked execution failed or not. (which is reasonable) The next polling interval will determine if the process is running or not. (which is why when you start a proc from monit its status is "initializing" until the next interval, at which point is set to "running")

I want to know if I can get monit to wait for the program exec to complete despite this understanding. If not, I'd like to see a configurable option that can be included in the process' config to do so in a future version.

Doing this would go a long way to addressing problem e-mail's like ours. I don't monitor the mailing list much anymore but I've seen more than a couple with this question.

As a work around I've decided to go with a monit unmonitor, then call the init.d script. When it comes time to start it up I call monit start so it starts and monitors in a single call.

Thanks!

- Chris

From: "Jason L. Buberel" <address@hidden>
Reply-To: This is the general mailing list for monit <address@hidden>
To: address@hidden
Subject: Re:Can monit block/wait on start/stop exec at all? (Chris McKenzie
Date: Thu, 17 May 2007 09:47:43 -0700

Chris,

I have run into the same problem you describe below and had event sent a message to this list regarding the issue. At the time, I did not receive any reply.

I know for a fact that monit is not blocking or waiting for the exec to complete when I see lines in my syslog like:

May 15 09:14:37 lenny monit[25262]: 'apache' trying to restart
May 15 09:14:37 lenny monit[25262]: 'apache' stop: /etc/init.d/httpd
May 15 09:14:39 lenny monit[25262]: 'apache' start: /etc/init.d/httpd

Notice the 2-second interval between 'stop' and 'start'? The problem is that my 'stop' script contains the following:

sleep 10

So unless my understanding of the theory of relativity is horribly wrong, there is definitely a problem here :)

-jason

address@hidden wrote:
----------------------------------------------------------------------

Date: Thu, 17 May 2007 11:51:28 -0400
From: "Chris McKenzie" <address@hidden>
Subject: Can monit block/wait on start/stop exec at all?
Hi all.

Can monit block or wait for a stop/start call to complete? I never had any problems with service restart scripts that would call monit to stop a bunch of service, perform some config or maintenance task, then start them back up again on RedHat Enterprise Linux 3, but after upgrading to RHEL4 I've been finding some strange behaviour that's not easy to nail down.

I don't know if its something new in RHEL4 or its kernel but monit will exec/fork the stop call and return or complete its own execution before the process has stopped. Even in cases where I've beefed up the init.d script to most definately wait for all pids to exit before returning.

Is there any way to get monit to block on program exec? This would be super helpful. I understand the reasons it currently doesn't and I'm fine with that. But if you could identify a single process in its config and block on the program's exec, it would make integrating/automating monit that much easier.

I can always build a wait block after the monit stop service calls before continuing but its the kind of thing you put into the init script.

Thanks!

- Chris




--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general




--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general






reply via email to

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