monit-general
[Top][All Lists]
Advanced

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

Re: Question about restart/stop


From: V.Krishn
Subject: Re: Question about restart/stop
Date: Tue, 5 Nov 2013 13:13:26 +0530
User-agent: KMail/1.13.7 (Linux/3.9.6-64; KDE/4.8.4; x86_64; ; )

On Tuesday, November 05, 2013 03:06:07 AM you wrote:
> On 03 Nov 2013, at 07:25, V.Krishn <address@hidden> wrote:
> > Was wondering why does monit not support ?
> > eg.
> > 
> >    restart program  = "/etc/init.d/<service> restart"
> 
> There is "stop program" and "start program" ... if you know how to stop and
> how to start, you know how to restart.
> 
> We may add standalone "restart" statement in the future, as some init
> scripts have specific restart command, but in general it shouldn't be
> necessary, as (stop -> start) == (restart)
> 
> Regards,
> Martin

<quote from wiki>
...
Here's a more advanced example for monitoring an apache web-server listening 
on the default port number for HTTP and HTTPS. In this example Monit will 
restart apache if it's not accepting connections at the port numbers. The 
method Monit use for a process restart is to first execute the stop-program, 
wait up to 30s for the process to stop and then execute the start-program and 
wait up to 30s for it to start. The length of start or stop timeout can be 
overridden using the 'timeout' option. If Monit was unable to stop or start 
the service a failed alert message will be sent if you have requested alert 
messages to be sent.

 check process apache with pidfile /var/run/httpd.pid
       start program = "/etc/init.d/httpd start" with timeout 60 seconds
       stop program  = "/etc/init.d/httpd stop"
       if failed port 80 then restart
       if failed port 443 with timeout 15 seconds then restart
...
</quote from wiki>

Reason:
Its not easy to estimate the timeout for some service, 
but I guess the "restart/reload" program will handle this.

Monit assumes the process to stop in given time i.e 30s
(eg. I have noticed serveral times for apache2 atleast)
What happens when the given process does not stop in 30s ?

-- 
Regards.
V.Krishn



reply via email to

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