<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I have a simple two-node cluster, node one and node two, with a single resource, ClusterMyApp. The nodes are CentOS 7 VMs. The resource is created executing the following line in node one:<div><br></div><div>   # pcs resource create ClusterMyApp ocf:myapp:myapp-script op monitor interval=30s<br></div><div><br></div><div>This invokes myapp-script, which I installed under /usr/lib/ocf/resource.d/myapp/myapp-script, both in one and two - i.e. it is exactly the same script in both nodes. </div><div><br></div><div>On executing the command above in node one, I get the following log entries in node one itself:</div><div><br></div><div><div>Apr 15 13:40:12 one crmd[13670]:  notice: Result of probe operation for ClusterMyApp on one: 7 (not running)</div><div>Apr 15 13:40:12 one crmd[13670]:  notice: Result of start operation for ClusterMyApp on one: 0 (ok)</div></div><div><br></div><div>This is in line with what I expect from myapp-script when invoked with the 'start' option (which is what the command above is doing.) myapp-script first checks out whether my app is running, and if it is not then launches it. The rest of the log entries are to do with my app, indicating that it started without any problems.</div><div><br></div><div>In node two, when the command above is executed in one, the following log entries are generated:</div><div><br></div><div><div>Apr 15 13:40:12 two crmd[4293]:  notice: State transition S_IDLE -> S_POLICY_ENGINE</div><div>Apr 15 13:40:12 two pengine[4292]:  notice:  * Start      ClusterMyApp     (one )</div><div>Apr 15 13:40:12 two pengine[4292]:  notice: Calculated transition 16, saving inputs in /var/lib/pacemaker/pengine/pe-input-66.bz2</div><div>Apr 15 13:40:12 two crmd[4293]:  notice: Initiating monitor operation ClusterMyApp_monitor_0 locally on two</div><div>Apr 15 13:40:12 two crmd[4293]:  notice: Initiating monitor operation ClusterMyApp_monitor_0 on one</div><div>Apr 15 13:40:12 two crmd[4293]:  notice: Result of probe operation for ClusterMyApp on two: 7 (not running)</div><div>Apr 15 13:40:12 two crmd[4293]:  notice: Initiating start operation ClusterMyApp_start_0 on one</div><div>Apr 15 13:40:12 two crmd[4293]:  notice: Initiating monitor operation ClusterMyApp_monitor_30000 on one</div><div>Apr 15 13:40:12 two crmd[4293]: warning: Action 4 (ClusterMyApp_monitor_30000) on one failed (target: 0 vs. rc: 7): Error</div><div>Apr 15 13:40:12 two crmd[4293]:  notice: Transition aborted by operation ClusterMyApp_monitor_30000 'create' on one: Event failed</div></div><div><br></div><div>After doing all of the above, pcs status returns the following, when invoked in either node:</div><div><br></div><div><div>Cluster name: MyCluster</div><div>Stack: corosync</div><div>Current DC: two (version 1.1.19-8.el7_6.4-c3c624ea3d) - partition with quorum</div><div>Last updated: Mon Apr 15 13:45:14 2019</div><div>Last change: Mon Apr 15 13:40:11 2019 by root via cibadmin on one</div><div><br></div><div>2 nodes configured</div><div>1 resource configured</div><div><br></div><div>Online: [ one two ]</div><div><br></div><div>Full list of resources:</div><div><br></div><div> ClusterMyApp<span style="white-space:pre">   </span>(ocf::myapp:myapp-script):<span style="white-space:pre">   </span>Started one</div><div><br></div><div>Failed Actions:</div><div>* ClusterMyApp_monitor_30000 on one 'not running' (7): call=37, status=complete, exitreason='',</div><div>    last-rc-change='Mon Apr 15 13:40:12 2019', queued=0ms, exec=105ms</div><div><br></div><div><br></div><div>Daemon Status:</div><div>  corosync: active/disabled</div><div>  pacemaker: active/disabled</div><div>  pcsd: active/enabled</div></div><div><br></div><div>The start function in this script is as follows:</div><div><br></div><div><div>myapp_start() {</div><div>  myapp_conf_check</div><div>  local diagnostic=$?</div><div><br></div><div>  if [ $diagnostic -ne $OCF_SUCCESS ]; then</div><div>    return $diagnostic</div><div>  fi</div><div><br></div><div>  myapp_monitor</div><div><br></div><div>  local state=$?</div><div><br></div><div>  case $state in</div><div>    $OCF_SUCCESS)</div><div>        return $OCF_SUCCESS</div><div>      ;;</div><div><br></div><div>    $OCF_NOT_RUNNING)</div><div>      myapp_launch > /dev/null 2>&1</div><div>      if [ $?  -eq 0 ]; then</div><div>        return $OCF_SUCCESS</div><div>      fi</div><div><br></div><div>      return $OCF_ERR_GENERIC</div><div>      ;;</div><div><br></div><div>    *)</div><div>      return $state</div><div>      ;;</div><div>  esac</div><div>}</div></div><div><br></div><div>I know for a fact that, in one, myapp_launch gets invoked, and that its exit value is 0. The function therefore returns OCF_SUCCESS, as it should. However, if I understand things correctly, the log entries in two seem to claim that the exit value of the script in one is OCF_NOT_RUNNING. </div><div><br></div><div>What's going on here? It's obviously something to do with myapp-script - but, what? <br></div><div><br></div><div><br></div></div></div></div></div></div></div>