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

Oyvind Albrigtsen oalbrigt at redhat.com
Fri Apr 13 08:21:57 EDT 2018


On 13/04/18 14:11 +0200, Nicolas Huillard wrote:
>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)"
You could simplify it by using for:
for x in $(seq 1 10); do ip link show ppp0 && exit; sleep 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 at 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



More information about the Users mailing list