<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body smarttemplateinserted="true" bgcolor="#FFFFFF" text="#000000">
    <div id="smartTemplate4-template"> </div>
    <br>
    <div id="smartTemplate4-quoteHeader"><br>
      <hr>
      <div><b>From: </b>Michael Schwartzkopff <a class="moz-txt-link-rfc2396E" href="mailto:ms@sys4.de"><ms@sys4.de></a></div>
      <div><b>Sent: </b> 2013-12-06 11:16:17 E</div>
      <div><b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</a></div>
      <div><b>Subject: </b>Re: [Pacemaker] monitor on-fail=ignore not
        restarting when resource reported as stopped</div>
      <br>
    </div>
    <blockquote cite="mid:1838726.Fx8ZST7ApV@nb003" type="cite">
      <pre wrap="">Am Freitag, 6. Dezember 2013, 11:02:11 schrieben Sie:
</pre>
      <blockquote type="cite">
        <pre wrap="">------------------------------------------------------------------------
*From: *Michael Schwartzkopff <a class="moz-txt-link-rfc2396E" href="mailto:ms@sys4.de"><ms@sys4.de></a>
*Sent: * 2013-12-06 10:50:19 E
*To: *The Pacemaker cluster resource manager <a class="moz-txt-link-rfc2396E" href="mailto:pacemaker@oss.clusterlabs.org"><pacemaker@oss.clusterlabs.org></a>
*Subject: *Re: [Pacemaker] monitor on-fail=ignore not restarting when
resource
reported as stopped

</pre>
        <blockquote type="cite">
          <pre wrap="">Am Freitag, 6. Dezember 2013, 10:11:07 schrieb Patrick Hemmer:
</pre>
          <blockquote type="cite">
            <pre wrap="">I have a resource which updates DNS records (Amazon's Route53). When it
performs it's `monitor` action, it can sometimes fail because of issues
with Amazon's API. So I want failures to be ignored for the monitor
action, and so I set `op monitor on-fail=ignore`. However now when the
monitor action comes back as 'stopped', pacemaker does nothing. In my
opinion a "stopped" return code should not be a failure condition, and
thus the `on-fail=ignore` should not apply. It basically makes the
monitor option completely useless. It won't do anything on failure, it
won't do anything on stopped, so you might as well not have a monitor
action at all.

If this is a bug I can create a bug report, just not sure if this is
deliberate or not.
</pre>
          </blockquote>
          <pre wrap="">
This is not bug but expected behaviour. A monitoring operation for a
started resource interpretes everything besides "Started" as failure.
Also if your resource is stopped.

And you told the resoure to ignore failures.

It would be better to improve your resource agent to detect error
conditions. It could read the state it should be in from pacemaker and
compare it with the reality.
</pre>
        </blockquote>
        <pre wrap="">
It does detect the error condition. It then returns with
$OCF_ERR_GENERIC. This is the only possible way to respond. It's also
the right way. If the script got an error trying to query the status, it
doesn't know if it's really running or not. If it's not running,
returning $OCF_SUCCESS would be a lie. If it is running, returning
$OCF_NOT_RUNNING would be a lie.

The monitor action can also be called by pacemaker even when the
resource is not running (ie, prior to starting it, or when pacemaker
first starts up). Thus returning $OCF_SUCCESS on error is not appropriate.
</pre>
      </blockquote>
      <pre wrap="">
So where is the problem? If the script returns "ERROR" than pacemaker has to 
acct accordingly.</pre>
    </blockquote>
    If the script returns "ERROR" the `on-fail=ignore` should make it do
    nothing. Amazon's API failed, we need to just retry again later.<br>
    If the script returns "STOPPED", this isn't an error. The script
    queried the resource, found it was stopped, and reported it as
    stopped. Pacemaker should act accordingly and start it back up.<br>
    <br>
    <blockquote cite="mid:1838726.Fx8ZST7ApV@nb003" type="cite">
      <pre wrap="">

Mit freundlichen Grüßen,

Michael Schwartzkopff

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Pacemaker mailing list: <a class="moz-txt-link-abbreviated" href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a>
<a class="moz-txt-link-freetext" href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a>

Project Home: <a class="moz-txt-link-freetext" href="http://www.clusterlabs.org">http://www.clusterlabs.org</a>
Getting started: <a class="moz-txt-link-freetext" href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a>
Bugs: <a class="moz-txt-link-freetext" href="http://bugs.clusterlabs.org">http://bugs.clusterlabs.org</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>