[Top][All Lists]

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

Re: Some little inconsistencies with "restart"...

From: Jan-Henrik Haukeland
Subject: Re: Some little inconsistencies with "restart"...
Date: 08 Jul 2002 17:10:23 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Christian Hopp <address@hidden> writes:

> 1.) If there is a service without start or stop statement, the restart
>     command can be executed.

No, read on

>  It should be only possible if both do exist.  Otherwise the service
>  might just be stopped.

This is what actually happens; monit does not restart a program unless
a start *and* a stop program is defined. (See validate.c:do_restart()).

> 2.) If the restart command is issued and the service does not exist in
>     the command file, monit does not simply say that it is not possible.
>     It warns that the "stop" and the "start" command cannot be executed
>     and in between it connects to the monit server.

Again monit does not connect to the monit server if a program is not
found, but it does print the: Please wait for restart: ... which can
give the impression that monit is doing something.


If you do a: 'monit restart' monit will loop through all entries in
the monitrc file and *only* restart those programs that have a start
and a stop program defined if not, the entry is skipped.

If you do a: 'monit restart apache' and apache is not found in the
monitrc file, monit will act as you describe in 2) but do nothing
except print the, "Please wait for restart: .........." string and
sleep for 10 seconds. 

In the second case it's probably a good idea to print instead:

monit: Cannot restart program 'sldkfj' -- not found in /home/hauk/.monitrc

and quit. I'll update the code with this change.

Jan-Henrik Haukeland

reply via email to

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