[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: restart program
From: |
Martin Pala |
Subject: |
Re: restart program |
Date: |
Fri, 21 Apr 2006 23:59:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060205 Debian/1.7.12-1.1 |
Hi,
this could be relatively easy to support - the event engine currently
has for historic reasons hardcoded handling for several events:
/* Initialize general event handlers */
addeventaction(&(current)->action_DATA,ACTION_ALERT,ACTION_ALERT);
addeventaction(&(current)->action_EXEC,ACTION_ALERT,ACTION_ALERT);
addeventaction(&(current)->action_INVALID,ACTION_RESTART,ACTION_ALERT);
addeventaction(&(current)->action_NONEXIST,ACTION_RESTART,ACTION_ALERT);
addeventaction(&(current)->action_TIMEOUT,ACTION_UNMONITOR,ACTION_ALERT);
We can add the support for default action override ... i'll look on it
when i'll have some spare time. The syntax can look like:
check process apache ...
if failed existence then exec "/path/to/script"
Martin
Mike Jackson wrote:
Would it be possible to add a "restart program" configuration option to
Monit, in addition to the "stop program" and "start program" options?
The reason I ask: Occasionally, if Monit needs to restart Apache, it
will issue the stop command. apachectl will return successfully almost
right away, even if the processes aren't completely terminated and the
ports freed. Monit thinks it's ready to start it up, and issues the
start command. Apache then (to use a technical term) freaks out and sits
there in limbo. It's not truly answering requests, but it also can't be
restarted. My init.d script was set to sleep 5 seconds between the start
and stop cycles if you issued the restart command line option; I moved
the sleep invocation to the stop cycle, but it would be nice if Monit
could issue a different command when it needs to restart, instead of
running the stop command and then the start command.
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
- restart program, Mike Jackson, 2006/04/18
- Re: restart program,
Martin Pala <=