[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha
Subject:    [Linux-HA] Re: start-delay for monitor operation not implemented?
From:       Stephen Souness <sounie () hotmail ! com>
Date:       2006-10-23 20:57:03
Message-ID: ehja1q$sul$1 () sea ! gmane ! org
[Download RAW message or body]

Max Hofer wrote:
> The definition "when is a reasource ready" is done by the resource agent, i.e. 
> if you say
> 
> -  "Tomcat is up" when you get a successful return code from the Tomcat-start 
> script it is ok. But your monitor/CIB has to take care when it can start to 
> test.
> 
> but IMHO it is a bad habit do work in this way because it may happen that 
> resources relying on Tomcat are started even if Tomcat is not really started.
> 
> What i did was following:
> 
> start operation: 
> - start tomcat with Catalina Start/Stop Script
> - in a loop: try to read the context via wget+parse until i get the desired 
> result or the loop counter times out
> 
> ---> in this way I'm sure that Tomcat is really up before i start a resource 
> which relies on Tomcat.
> 

That's the approach that I have since taken for my stop operation.

As Eddie mentioned in another post on this thread, the stop operation 
can also be tricky to detect as having successfully completed for Tomcat.

In some scenarios one could use the Tomcat shutdown script to stop 
Tomcat, but if you want to start it again shortly thereafter then a 
check for not being able to establish a connection may not be enough, as 
Tomcat may have shut down its http request processing threads but could 
still be alive and locking other resources which would prevent the 
startup script from succeeding.

A check for the existence of a Tomcat process with the last known pid 
(using the CATALINA_PID environment variable to have it recorded in a 
file) is something that I am considering as an additional check for the 
stop operation, possibly followed up by a kill - like in the apache 
script supplied with heartbeat.

--
Stephen

_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic