[ClusterLabs] [solved] heartbeat/anything Resource Agent : "wait for proper service before ending the start operation"

Nicolas Huillard nicolas at huillard.net
Fri Apr 13 08:11:33 EDT 2018

Le vendredi 13 avril 2018 à 11:15 +0200, Oyvind Albrigtsen a écrit :
> On 13/04/18 11:07 +0200, Nicolas Huillard wrote:
> > I figured that fixing this would require to add a monitor call
> > inside the start operation, and wait for a successful monitor
> > before returning OCF_SUCCESS, within the start timeout.
> > 
> > Is it a correct approach?
> > Are there some other standard way to fix this, like a "wait for
> > condition" Resource Agent?
> You could try using the monitor_hook parameter to check the status, 

What I came up with is:

monitor_hook="(i=50; while [ $i -gt 0 ]; do ip link show ppp0 && exit
0; sleep 5; i=$((i+5)); done; exit 1)"

The "active" part of it being "ip link show ppp0". The rest is a loop
to wait the least possible (at 5s interval).

This works with resource-agents 4.1.1, not 4.0.0 that I initially used.

Nicolas Huillard

More information about the Users mailing list