Hi,<br><br>I have structured my multi-state resource agent as below when the underlying resource becomes unavailable for some reason:<br><br>monitor()<br>{<br> state=get_primitive_resource_state()<br><br> ...<br> ... <br>
if ($state == unavailable)<br> return $OCF_NOT_RUNNING<br><br> ...<br> ...<br>}<br><br>stop()<br>{<br> monitor()<br> ret=$?<br><br> if (ret == $OCF_NOT_RUNNING)<br> return $OCF_SUCCESS<br>}<br>
<br>start()<br>
{<br>
start_primitive()<br>
if (start_primitive_failure)<br>
return OCF_ERR_GENERIC<br>
}<br>
<br>
The idea is to make sure that stop does not fail when the underlying resource goes away.<br>(Otherwise I see that the resource gets to an unmanaged state)<br>Also, the expectation is that when the resource comes back, it joins the cluster without much fuss.<br>
<br>What I see is that pacemaker calls stop twice and if it finds that stop returns success,<br>it does not continue with monitor any more. I also do not see an attempt to start.<br><br>Is there a way to keep the monitor going in such circumstances?<br>
Am I using incorrect resource agent return codes?<br><br>Thanks,<br>Pavan<br>