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
_______________________________________________
Users mailing list: Users@clusterlabs.org
https://lists.clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org

Reply via email to