Hi,

I use heartbeat-2.1.2, consider the following configurations:
<cib>
<configuration>
<crm_config> .... </crm_config>
<nodes>
  <node uname="node0" id="node0"/>
</nodes>
<resources>
  <primative id="rsc_xxx" class="ocf" type="Stateful" provider="heartbeat" 
is_managed="true">
  </primative>
</resources>
<constraints>
  <rsc_location id="location_xxx" rsc="rsc_xxx">
    <rule id="location_xxx_rule" score="-infinity"/>
  </rsc_location>
</constraints>
</configuration>
</cib>

I want to code a program which can start/stop a resource, and I want the 
function to be synchronous.
  static BOOL cib_updated=FALSE;
  void on_cib_diff()
  {
    cib_updated=TRUE;
  }
  int start_xxx()
  {
     cib_t *cib=cib_new();
     cib->cmds->signon();
     cib_conn->cmds->add_notify_callback(cib, T_CIB_DIFF_NOTIFY, on_cib_diff);

     code with effect: cibadmin -D -o constraints -X '<rsc_location 
id="location_xxx"/>'
     while(cib_updated==FALSE) sleep(1);
     /* Now, cib has been updated, and will trigger the pengine/tengine to 
start the resource
        MY QUESTION IS:
        WHEN and HOW can i determine that the resource xxx has been started 
successfully???????
     */

     cib->cmds->signoff();
     cib=NULL;
  }
    


Thanks,
jacker

 
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to