Blame SOURCES/bz720543-pcmk-reduce_duplication_by_merging_the_lrmd_exec_rc_enum_with_ocf_exitcode.patch

ed0026
commit 6de9bff49d55a5e03f3aac134fa651da02acc805
ed0026
Author: Andrew Beekhof <andrew@beekhof.net>
ed0026
Date:   Thu Aug 8 10:07:43 2013 +1000
ed0026
ed0026
    Refactor: Reduce duplication by merging the lrmd_exec_rc enum with ocf_exitcode
ed0026
    
ed0026
    (cherry picked from commit 7c87227849a589b65eb4864fae2811d9cc39bc1b)
ed0026
ed0026
diff --git a/crmd/lrm.c b/crmd/lrm.c
ed0026
index 5f4d3bb..318c7f8 100644
ed0026
--- a/crmd/lrm.c
ed0026
+++ b/crmd/lrm.c
ed0026
@@ -691,20 +691,20 @@ is_rsc_active(lrm_state_t * lrm_state, const char *rsc_id)
ed0026
 
ed0026
     crm_trace("Processing %s: %s.%d=%d",
ed0026
               rsc_id, entry->last->op_type, entry->last->interval, entry->last->rc);
ed0026
-    if (entry->last->rc == PCMK_EXECRA_OK && safe_str_eq(entry->last->op_type, CRMD_ACTION_STOP)) {
ed0026
+    if (entry->last->rc == PCMK_OCF_OK && safe_str_eq(entry->last->op_type, CRMD_ACTION_STOP)) {
ed0026
         return FALSE;
ed0026
 
ed0026
-    } else if (entry->last->rc == PCMK_EXECRA_OK
ed0026
+    } else if (entry->last->rc == PCMK_OCF_OK
ed0026
                && safe_str_eq(entry->last->op_type, CRMD_ACTION_MIGRATE)) {
ed0026
         /* a stricter check is too complex...
ed0026
          * leave that to the PE
ed0026
          */
ed0026
         return FALSE;
ed0026
 
ed0026
-    } else if (entry->last->rc == PCMK_EXECRA_NOT_RUNNING) {
ed0026
+    } else if (entry->last->rc == PCMK_OCF_NOT_RUNNING) {
ed0026
         return FALSE;
ed0026
 
ed0026
-    } else if (entry->last->interval == 0 && entry->last->rc == PCMK_EXECRA_NOT_CONFIGURED) {
ed0026
+    } else if (entry->last->interval == 0 && entry->last->rc == PCMK_OCF_NOT_CONFIGURED) {
ed0026
         /* Badly configured resources can't be reliably stopped */
ed0026
         return FALSE;
ed0026
     }
ed0026
@@ -812,10 +812,10 @@ notify_deleted(lrm_state_t * lrm_state, ha_msg_input_t * input, const char *rsc_
ed0026
 
ed0026
     if (rc == pcmk_ok) {
ed0026
         op->op_status = PCMK_LRM_OP_DONE;
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
     } else {
ed0026
         op->op_status = PCMK_LRM_OP_ERROR;
ed0026
-        op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+        op->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
     }
ed0026
 
ed0026
     send_direct_ack(from_host, from_sys, NULL, op, rsc_id);
ed0026
@@ -1295,7 +1295,7 @@ do_lrm_invoke(long long action,
ed0026
         }
ed0026
         op->interval = 0;
ed0026
         op->op_status = PCMK_LRM_OP_DONE;
ed0026
-        op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+        op->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
         op->t_run = time(NULL);
ed0026
         op->t_rcchange = op->t_run;
ed0026
 
ed0026
@@ -1313,7 +1313,7 @@ do_lrm_invoke(long long action,
ed0026
             crm_info("Failing resource %s...", rsc->id);
ed0026
             process_lrm_event(lrm_state, op);
ed0026
             op->op_status = PCMK_LRM_OP_DONE;
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
             lrmd_free_rsc_info(rsc);
ed0026
         } else {
ed0026
             crm_info("Cannot find/create resource in order to fail it...");
ed0026
@@ -1425,7 +1425,7 @@ do_lrm_invoke(long long action,
ed0026
 
ed0026
             op = construct_op(lrm_state, input->xml, ID(xml_rsc), operation);
ed0026
             op->op_status = PCMK_LRM_OP_DONE;
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
             CRM_ASSERT(op != NULL);
ed0026
             send_direct_ack(from_host, from_sys, NULL, op, ID(xml_rsc));
ed0026
             lrmd_free_event(op);
ed0026
@@ -1486,7 +1486,7 @@ do_lrm_invoke(long long action,
ed0026
                 g_hash_table_remove(lrm_state->pending_ops, op_key);
ed0026
             }
ed0026
 
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
             op->op_status = PCMK_LRM_OP_DONE;
ed0026
             send_direct_ack(from_host, from_sys, rsc, op, rsc->id);
ed0026
 
ed0026
@@ -1509,9 +1509,9 @@ do_lrm_invoke(long long action,
ed0026
                 op->op_status = PCMK_LRM_OP_ERROR;
ed0026
 
ed0026
                 if (cib_rc == -EACCES) {
ed0026
-                    op->rc = PCMK_EXECRA_INSUFFICIENT_PRIV;
ed0026
+                    op->rc = PCMK_OCF_INSUFFICIENT_PRIV;
ed0026
                 } else {
ed0026
-                    op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+                    op->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
                 }
ed0026
                 send_direct_ack(from_host, from_sys, NULL, op, rsc->id);
ed0026
                 lrmd_free_event(op);
ed0026
@@ -2046,7 +2046,7 @@ process_lrm_event(lrm_state_t * lrm_state, lrmd_event_data_t * op)
ed0026
     }
ed0026
 
ed0026
     if (op->op_status == PCMK_LRM_OP_ERROR
ed0026
-        && (op->rc == PCMK_EXECRA_RUNNING_MASTER || op->rc == PCMK_EXECRA_NOT_RUNNING)) {
ed0026
+        && (op->rc == PCMK_OCF_RUNNING_MASTER || op->rc == PCMK_OCF_NOT_RUNNING)) {
ed0026
         /* Leave it up to the TE/PE to decide if this is an error */
ed0026
         op->op_status = PCMK_LRM_OP_DONE;
ed0026
         log_level = LOG_INFO;
ed0026
@@ -2096,7 +2096,7 @@ process_lrm_event(lrm_state_t * lrm_state, lrmd_event_data_t * op)
ed0026
         do_crm_log(log_level,
ed0026
                    "LRM operation %s (call=%d, rc=%d, cib-update=%d, confirmed=%s) %s",
ed0026
                    op_key, op->call_id, op->rc, update_id, removed ? "true" : "false",
ed0026
-                   lrmd_event_rc2str(op->rc));
ed0026
+                   services_ocf_exitcode_str(op->rc));
ed0026
     } else {
ed0026
         do_crm_log(log_level,
ed0026
                    "LRM operation %s (call=%d, status=%d, cib-update=%d, confirmed=%s) %s",
ed0026
diff --git a/crmd/remote_lrmd_ra.c b/crmd/remote_lrmd_ra.c
ed0026
index 42ea043..fbb9ecb 100644
ed0026
--- a/crmd/remote_lrmd_ra.c
ed0026
+++ b/crmd/remote_lrmd_ra.c
ed0026
@@ -211,7 +211,7 @@ retry_start_cmd_cb(gpointer data)
ed0026
     }
ed0026
 
ed0026
     if (rc != 0) {
ed0026
-        cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+        cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
         cmd->op_status = PCMK_LRM_OP_ERROR;
ed0026
         report_remote_ra_result(cmd);
ed0026
 
ed0026
@@ -236,7 +236,7 @@ monitor_timeout_cb(gpointer data)
ed0026
     crm_debug("Poke async response timed out for node %s", cmd->rsc_id);
ed0026
     cmd->monitor_timeout_id = 0;
ed0026
     cmd->op_status = PCMK_LRM_OP_TIMEOUT;
ed0026
-    cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+    cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
 
ed0026
     lrm_state = lrm_state_find(cmd->rsc_id);
ed0026
     if (lrm_state && lrm_state->remote_ra_data) {
ed0026
@@ -291,7 +291,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
ed0026
               lrmd_event_type2str(op->type),
ed0026
               op->remote_nodename,
ed0026
               op->op_type ? op->op_type : "none",
ed0026
-              lrmd_event_rc2str(op->rc), services_lrm_status_str(op->op_status));
ed0026
+              services_ocf_exitcode_str(op->rc), services_lrm_status_str(op->op_status));
ed0026
 
ed0026
     /* filter all EXEC events up */
ed0026
     if (op->type == lrmd_event_exec_complete) {
ed0026
@@ -329,7 +329,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
ed0026
                           cmd->remaining_timeout);
ed0026
             }
ed0026
             cmd->op_status = PCMK_LRM_OP_TIMEOUT;
ed0026
-            cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+            cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
 
ed0026
         } else {
ed0026
             /* make sure we have a clean status section to start with */
ed0026
@@ -338,7 +338,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
ed0026
             erase_status_tag(lrm_state->node_name, XML_CIB_TAG_LRM, cib_scope_local);
ed0026
             erase_status_tag(lrm_state->node_name, XML_TAG_TRANSIENT_NODEATTRS, cib_scope_local);
ed0026
 
ed0026
-            cmd->rc = PCMK_EXECRA_OK;
ed0026
+            cmd->rc = PCMK_OCF_OK;
ed0026
             cmd->op_status = PCMK_LRM_OP_DONE;
ed0026
         }
ed0026
 
ed0026
@@ -361,7 +361,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
ed0026
          * For this function, if we get the poke pack, it is always a success. Pokes
ed0026
          * only fail if the send fails, or the response times out. */
ed0026
         if (!cmd->reported_success) {
ed0026
-            cmd->rc = PCMK_EXECRA_OK;
ed0026
+            cmd->rc = PCMK_OCF_OK;
ed0026
             cmd->op_status = PCMK_LRM_OP_DONE;
ed0026
             report_remote_ra_result(cmd);
ed0026
             cmd->reported_success = 1;
ed0026
@@ -442,7 +442,7 @@ handle_remote_ra_exec(gpointer user_data)
ed0026
                 return TRUE;
ed0026
             } else {
ed0026
                 crm_debug("connect failed, not expecting to match any connection event later");
ed0026
-                cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+                cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
                 cmd->op_status = PCMK_LRM_OP_ERROR;
ed0026
             }
ed0026
             report_remote_ra_result(cmd);
ed0026
@@ -452,13 +452,13 @@ handle_remote_ra_exec(gpointer user_data)
ed0026
             if (lrm_state_is_connected(lrm_state) == TRUE) {
ed0026
                 rc = lrm_state_poke_connection(lrm_state);
ed0026
                 if (rc < 0) {
ed0026
-                    cmd->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+                    cmd->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
                     cmd->op_status = PCMK_LRM_OP_ERROR;
ed0026
                 }
ed0026
             } else {
ed0026
                 rc = -1;
ed0026
                 cmd->op_status = PCMK_LRM_OP_DONE;
ed0026
-                cmd->rc = PCMK_EXECRA_NOT_RUNNING;
ed0026
+                cmd->rc = PCMK_OCF_NOT_RUNNING;
ed0026
             }
ed0026
 
ed0026
             if (rc == 0) {
ed0026
@@ -471,7 +471,7 @@ handle_remote_ra_exec(gpointer user_data)
ed0026
 
ed0026
         } else if (!strcmp(cmd->action, "stop")) {
ed0026
             lrm_state_disconnect(lrm_state);
ed0026
-            cmd->rc = PCMK_EXECRA_OK;
ed0026
+            cmd->rc = PCMK_OCF_OK;
ed0026
             cmd->op_status = PCMK_LRM_OP_DONE;
ed0026
 
ed0026
             if (ra_data->cmds) {
ed0026
@@ -486,7 +486,7 @@ handle_remote_ra_exec(gpointer user_data)
ed0026
 
ed0026
         } else if (!strcmp(cmd->action, "migrate_to")) {
ed0026
             /* no-op. */
ed0026
-            cmd->rc = PCMK_EXECRA_OK;
ed0026
+            cmd->rc = PCMK_OCF_OK;
ed0026
             cmd->op_status = PCMK_LRM_OP_DONE;
ed0026
             report_remote_ra_result(cmd);
ed0026
         }
ed0026
diff --git a/crmd/te_actions.c b/crmd/te_actions.c
ed0026
index b533f58..63d15bb 100644
ed0026
--- a/crmd/te_actions.c
ed0026
+++ b/crmd/te_actions.c
ed0026
@@ -465,7 +465,7 @@ te_rsc_command(crm_graph_t * graph, crm_action_t * action)
ed0026
         && safe_str_neq(task, CRMD_ACTION_DELETE)) {
ed0026
         /* write a "pending" entry to the CIB, inhibit notification */
ed0026
         crm_debug("Recording pending op %s in the CIB", task_uuid);
ed0026
-        cib_action_update(action, PCMK_LRM_OP_PENDING, PCMK_EXECRA_STATUS_UNKNOWN);
ed0026
+        cib_action_update(action, PCMK_LRM_OP_PENDING, PCMK_OCF_STATUS_UNKNOWN);
ed0026
     }
ed0026
 
ed0026
     return TRUE;
ed0026
diff --git a/crmd/te_callbacks.c b/crmd/te_callbacks.c
ed0026
index 3d923b2..c0360b4 100644
ed0026
--- a/crmd/te_callbacks.c
ed0026
+++ b/crmd/te_callbacks.c
ed0026
@@ -548,8 +548,8 @@ action_timer_callback(gpointer data)
ed0026
         }
ed0026
 
ed0026
         if (send_update) {
ed0026
-            /* cib_action_update(timer->action, PCMK_LRM_OP_PENDING, PCMK_EXECRA_STATUS_UNKNOWN); */
ed0026
-            cib_action_update(timer->action, PCMK_LRM_OP_TIMEOUT, PCMK_EXECRA_UNKNOWN_ERROR);
ed0026
+            /* cib_action_update(timer->action, PCMK_LRM_OP_PENDING, PCMK_OCF_STATUS_UNKNOWN); */
ed0026
+            cib_action_update(timer->action, PCMK_LRM_OP_TIMEOUT, PCMK_OCF_UNKNOWN_ERROR);
ed0026
         }
ed0026
     }
ed0026
 
ed0026
diff --git a/crmd/te_events.c b/crmd/te_events.c
ed0026
index bc474bd..78d00dd 100644
ed0026
--- a/crmd/te_events.c
ed0026
+++ b/crmd/te_events.c
ed0026
@@ -540,7 +540,7 @@ process_graph_event(xmlNode * event, const char *event_node)
ed0026
             desc = "failed";
ed0026
         }
ed0026
         crm_info("Detected action (%d.%d) %s.%d=%s: %s", transition_num, action, id, callid,
ed0026
-                 lrmd_event_rc2str(rc), desc);
ed0026
+                 services_ocf_exitcode_str(rc), desc);
ed0026
     }
ed0026
 
ed0026
   bail:
ed0026
diff --git a/fencing/commands.c b/fencing/commands.c
ed0026
index 7ef003d..7d04952 100644
ed0026
--- a/fencing/commands.c
ed0026
+++ b/fencing/commands.c
ed0026
@@ -224,7 +224,7 @@ stonith_device_execute(stonith_device_t * device)
ed0026
         } else {
ed0026
             crm_err("failed to get secrets for %s, "
ed0026
                     "considering resource not configured", device->id);
ed0026
-            exec_rc = PCMK_EXECRA_NOT_CONFIGURED;
ed0026
+            exec_rc = PCMK_OCF_NOT_CONFIGURED;
ed0026
             cmd->done_cb(0, exec_rc, NULL, cmd);
ed0026
             return TRUE;
ed0026
         }
ed0026
diff --git a/include/crm/lrmd.h b/include/crm/lrmd.h
ed0026
index f627373..b8c3167 100644
ed0026
--- a/include/crm/lrmd.h
ed0026
+++ b/include/crm/lrmd.h
ed0026
@@ -22,6 +22,7 @@
ed0026
  * \brief Local Resource Manager 
ed0026
  * \ingroup lrm
ed0026
  */
ed0026
+#include <crm/services.h>
ed0026
 
ed0026
 #ifndef LRMD__H
ed0026
 #  define LRMD__H
ed0026
@@ -166,21 +167,6 @@ enum lrmd_callback_event {
ed0026
     lrmd_event_poke,
ed0026
 };
ed0026
 
ed0026
-enum lrmd_exec_rc {
ed0026
-    PCMK_EXECRA_OK                  = 0,
ed0026
-    PCMK_EXECRA_UNKNOWN_ERROR       = 1,
ed0026
-    PCMK_EXECRA_INVALID_PARAM       = 2,
ed0026
-    PCMK_EXECRA_UNIMPLEMENT_FEATURE = 3,
ed0026
-    PCMK_EXECRA_INSUFFICIENT_PRIV   = 4,
ed0026
-    PCMK_EXECRA_NOT_INSTALLED       = 5,
ed0026
-    PCMK_EXECRA_NOT_CONFIGURED      = 6,
ed0026
-    PCMK_EXECRA_NOT_RUNNING         = 7,
ed0026
-    PCMK_EXECRA_RUNNING_MASTER      = 8,
ed0026
-    PCMK_EXECRA_FAILED_MASTER       = 9,
ed0026
-
ed0026
-    /* For status command only */
ed0026
-    PCMK_EXECRA_STATUS_UNKNOWN      = 14,
ed0026
-};
ed0026
 /* *INDENT-ON* */
ed0026
 
ed0026
 typedef struct lrmd_event_data_s {
ed0026
@@ -205,8 +191,8 @@ typedef struct lrmd_event_data_s {
ed0026
     /*! This operation that just completed is on a deleted rsc. */
ed0026
     int rsc_deleted;
ed0026
 
ed0026
-    /*! The executed ra return code */
ed0026
-    enum lrmd_exec_rc rc;
ed0026
+    /*! The executed ra return code mapped to OCF */
ed0026
+    enum ocf_exitcode rc;
ed0026
     /*! The lrmd status returned for exec_complete events */
ed0026
     int op_status;
ed0026
     /*! stdout from resource agent operation */
ed0026
@@ -448,38 +434,6 @@ struct lrmd_s {
ed0026
 };
ed0026
 
ed0026
 static inline const char *
ed0026
-lrmd_event_rc2str(enum lrmd_exec_rc rc)
ed0026
-{
ed0026
-    switch (rc) {
ed0026
-        case PCMK_EXECRA_OK:
ed0026
-            return "ok";
ed0026
-        case PCMK_EXECRA_UNKNOWN_ERROR:
ed0026
-            return "unknown error";
ed0026
-        case PCMK_EXECRA_INVALID_PARAM:
ed0026
-            return "invalid parameter";
ed0026
-        case PCMK_EXECRA_UNIMPLEMENT_FEATURE:
ed0026
-            return "unimplemented feature";
ed0026
-        case PCMK_EXECRA_INSUFFICIENT_PRIV:
ed0026
-            return "insufficient privileges";
ed0026
-        case PCMK_EXECRA_NOT_INSTALLED:
ed0026
-            return "not installed";
ed0026
-        case PCMK_EXECRA_NOT_CONFIGURED:
ed0026
-            return "not configured";
ed0026
-        case PCMK_EXECRA_NOT_RUNNING:
ed0026
-            return "not running";
ed0026
-        case PCMK_EXECRA_RUNNING_MASTER:
ed0026
-            return "master";
ed0026
-        case PCMK_EXECRA_FAILED_MASTER:
ed0026
-            return "master (failed)";
ed0026
-        case PCMK_EXECRA_STATUS_UNKNOWN:
ed0026
-            return "status: unknown";
ed0026
-        default:
ed0026
-            break;
ed0026
-    }
ed0026
-    return "<unknown>";
ed0026
-}
ed0026
-
ed0026
-static inline const char *
ed0026
 lrmd_event_type2str(enum lrmd_callback_event type)
ed0026
 {
ed0026
     switch (type) {
ed0026
diff --git a/include/crm/services.h b/include/crm/services.h
ed0026
index fb5c6b0..0c0cca9 100644
ed0026
--- a/include/crm/services.h
ed0026
+++ b/include/crm/services.h
ed0026
@@ -31,6 +31,7 @@ extern "C" {
ed0026
 
ed0026
 #  include <glib.h>
ed0026
 #  include <stdio.h>
ed0026
+#  include <string.h>
ed0026
 
ed0026
 #  ifndef OCF_ROOT_DIR
ed0026
 #    define OCF_ROOT_DIR "/usr/lib/ocf"
ed0026
@@ -59,34 +60,22 @@ enum lsb_exitcode {
ed0026
     PCMK_LSB_NOT_INSTALLED       = 5,
ed0026
     PCMK_LSB_NOT_CONFIGURED      = 6,
ed0026
     PCMK_LSB_NOT_RUNNING         = 7,
ed0026
-
ed0026
-    /* 150-199	reserved for application use */
ed0026
-    PCMK_LSB_SIGNAL        = 194,
ed0026
-    PCMK_LSB_NOT_SUPPORTED = 195,
ed0026
-    PCMK_LSB_PENDING       = 196,
ed0026
-    PCMK_LSB_CANCELLED     = 197,
ed0026
-    PCMK_LSB_TIMEOUT       = 198,
ed0026
-    PCMK_LSB_OTHER_ERROR   = 199,
ed0026
 };
ed0026
 
ed0026
 /* The return codes for the status operation are not the same for other
ed0026
- * operatios - go figure */
ed0026
+ * operatios - go figure
ed0026
+ */
ed0026
 enum lsb_status_exitcode {
ed0026
     PCMK_LSB_STATUS_OK             = 0,
ed0026
     PCMK_LSB_STATUS_VAR_PID        = 1,
ed0026
     PCMK_LSB_STATUS_VAR_LOCK       = 2,
ed0026
     PCMK_LSB_STATUS_NOT_RUNNING    = 3,
ed0026
     PCMK_LSB_STATUS_NOT_INSTALLED  = 4,
ed0026
-
ed0026
-    /* 150-199 reserved for application use */
ed0026
-    PCMK_LSB_STATUS_SIGNAL        = 194,
ed0026
-    PCMK_LSB_STATUS_NOT_SUPPORTED = 195,
ed0026
-    PCMK_LSB_STATUS_PENDING       = 196,
ed0026
-    PCMK_LSB_STATUS_CANCELLED     = 197,
ed0026
-    PCMK_LSB_STATUS_TIMEOUT       = 198,
ed0026
-    PCMK_LSB_STATUS_OTHER_ERROR   = 199,
ed0026
 };
ed0026
 
ed0026
+/* Uniform exit codes
ed0026
+ * Everything is mapped to its OCF equivalent so that Pacemaker only deals with one set of codes
ed0026
+ */
ed0026
 enum ocf_exitcode {
ed0026
     PCMK_OCF_OK                   = 0,
ed0026
     PCMK_OCF_UNKNOWN_ERROR        = 1,
ed0026
@@ -95,10 +84,12 @@ enum ocf_exitcode {
ed0026
     PCMK_OCF_INSUFFICIENT_PRIV    = 4,
ed0026
     PCMK_OCF_NOT_INSTALLED        = 5,
ed0026
     PCMK_OCF_NOT_CONFIGURED       = 6,
ed0026
-    PCMK_OCF_NOT_RUNNING          = 7,
ed0026
+    PCMK_OCF_NOT_RUNNING          = 7,  /* End of overlap with LSB */
ed0026
     PCMK_OCF_RUNNING_MASTER       = 8,
ed0026
     PCMK_OCF_FAILED_MASTER        = 9,
ed0026
 
ed0026
+    PCMK_OCF_STATUS_UNKNOWN       = 14, /* Already in use */
ed0026
+
ed0026
     /* 150-199	reserved for application use */
ed0026
     PCMK_OCF_SIGNAL        = 194,
ed0026
     PCMK_OCF_NOT_SUPPORTED = 195,
ed0026
@@ -114,7 +105,7 @@ enum op_status {
ed0026
     PCMK_LRM_OP_CANCELLED,
ed0026
     PCMK_LRM_OP_TIMEOUT,
ed0026
     PCMK_LRM_OP_NOTSUPPORTED,
ed0026
-    PCMK_LRM_OP_ERROR
ed0026
+    PCMK_LRM_OP_ERROR,
ed0026
 };
ed0026
 
ed0026
 enum nagios_exitcode {
ed0026
@@ -276,25 +267,25 @@ enum nagios_exitcode {
ed0026
     }} static inline const char *services_ocf_exitcode_str(enum ocf_exitcode code) {
ed0026
         switch (code) {
ed0026
             case PCMK_OCF_OK:
ed0026
-                return "OCF_OK";
ed0026
+                return "ok";
ed0026
             case PCMK_OCF_UNKNOWN_ERROR:
ed0026
-                return "OCF_UNKNOWN_ERROR";
ed0026
+                return "unknown error";
ed0026
             case PCMK_OCF_INVALID_PARAM:
ed0026
-                return "OCF_INVALID_PARAM";
ed0026
+                return "invalid parameter";
ed0026
             case PCMK_OCF_UNIMPLEMENT_FEATURE:
ed0026
-                return "OCF_UNIMPLEMENT_FEATURE";
ed0026
+                return "unimplemented feature";
ed0026
             case PCMK_OCF_INSUFFICIENT_PRIV:
ed0026
-                return "OCF_INSUFFICIENT_PRIV";
ed0026
+                return "insufficient privileges";
ed0026
             case PCMK_OCF_NOT_INSTALLED:
ed0026
-                return "OCF_NOT_INSTALLED";
ed0026
+                return "not installed";
ed0026
             case PCMK_OCF_NOT_CONFIGURED:
ed0026
-                return "OCF_NOT_CONFIGURED";
ed0026
+                return "not configured";
ed0026
             case PCMK_OCF_NOT_RUNNING:
ed0026
-                return "OCF_NOT_RUNNING";
ed0026
+                return "not running";
ed0026
             case PCMK_OCF_RUNNING_MASTER:
ed0026
-                return "OCF_RUNNING_MASTER";
ed0026
+                return "master";
ed0026
             case PCMK_OCF_FAILED_MASTER:
ed0026
-                return "OCF_FAILED_MASTER";
ed0026
+                return "master (failed)";
ed0026
             case PCMK_OCF_SIGNAL:
ed0026
                 return "OCF_SIGNAL";
ed0026
             case PCMK_OCF_NOT_SUPPORTED:
ed0026
diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
ed0026
index 26cecb2..78ceb85 100644
ed0026
--- a/lib/pengine/unpack.c
ed0026
+++ b/lib/pengine/unpack.c
ed0026
@@ -2205,8 +2205,8 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
             task_status_i = PCMK_LRM_OP_ERROR;
ed0026
             pe_rsc_debug(rsc, "%s on %s returned %d (%s) instead of the expected value: %d (%s)",
ed0026
                          id, node->details->uname,
ed0026
-                         actual_rc_i, lrmd_event_rc2str(actual_rc_i),
ed0026
-                         target_rc, lrmd_event_rc2str(target_rc));
ed0026
+                         actual_rc_i, services_ocf_exitcode_str(actual_rc_i),
ed0026
+                         target_rc, services_ocf_exitcode_str(target_rc));
ed0026
         }
ed0026
 
ed0026
     } else if (task_status_i == PCMK_LRM_OP_ERROR) {
ed0026
@@ -2215,7 +2215,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
     }
ed0026
 
ed0026
     if (task_status_i == PCMK_LRM_OP_NOTSUPPORTED) {
ed0026
-        actual_rc_i = PCMK_EXECRA_UNIMPLEMENT_FEATURE;
ed0026
+        actual_rc_i = PCMK_OCF_UNIMPLEMENT_FEATURE;
ed0026
     }
ed0026
 
ed0026
     if (expired) {
ed0026
@@ -2254,8 +2254,8 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
     }
ed0026
 
ed0026
     if (expired
ed0026
-        && actual_rc_i != PCMK_EXECRA_NOT_RUNNING
ed0026
-        && actual_rc_i != PCMK_EXECRA_RUNNING_MASTER && actual_rc_i != PCMK_EXECRA_OK) {
ed0026
+        && actual_rc_i != PCMK_OCF_NOT_RUNNING
ed0026
+        && actual_rc_i != PCMK_OCF_RUNNING_MASTER && actual_rc_i != PCMK_OCF_OK) {
ed0026
         if(interval == 0) {
ed0026
             crm_notice("Ignoring expired failure %s (rc=%d, magic=%s) on %s",
ed0026
                        id, actual_rc_i, magic, node->details->uname);
ed0026
@@ -2273,7 +2273,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
      * didnt include target_rc and liked to remap status
ed0026
      */
ed0026
     switch (actual_rc_i) {
ed0026
-        case PCMK_EXECRA_NOT_RUNNING:
ed0026
+        case PCMK_OCF_NOT_RUNNING:
ed0026
             if (is_probe || target_rc == actual_rc_i) {
ed0026
                 task_status_i = PCMK_LRM_OP_DONE;
ed0026
                 rsc->role = RSC_ROLE_STOPPED;
ed0026
@@ -2287,7 +2287,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
             }
ed0026
             break;
ed0026
 
ed0026
-        case PCMK_EXECRA_RUNNING_MASTER:
ed0026
+        case PCMK_OCF_RUNNING_MASTER:
ed0026
             if (is_probe) {
ed0026
                 task_status_i = PCMK_LRM_OP_DONE;
ed0026
                 crm_notice("Operation %s found resource %s active in master mode on %s",
ed0026
@@ -2311,42 +2311,42 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
             rsc->role = RSC_ROLE_MASTER;
ed0026
             break;
ed0026
 
ed0026
-        case PCMK_EXECRA_FAILED_MASTER:
ed0026
+        case PCMK_OCF_FAILED_MASTER:
ed0026
             rsc->role = RSC_ROLE_MASTER;
ed0026
             task_status_i = PCMK_LRM_OP_ERROR;
ed0026
             break;
ed0026
 
ed0026
-        case PCMK_EXECRA_UNIMPLEMENT_FEATURE:
ed0026
+        case PCMK_OCF_UNIMPLEMENT_FEATURE:
ed0026
             if (interval > 0) {
ed0026
                 task_status_i = PCMK_LRM_OP_NOTSUPPORTED;
ed0026
                 break;
ed0026
             }
ed0026
             /* else: fall through */
ed0026
-        case PCMK_EXECRA_INSUFFICIENT_PRIV:
ed0026
-        case PCMK_EXECRA_NOT_INSTALLED:
ed0026
-        case PCMK_EXECRA_INVALID_PARAM:
ed0026
+        case PCMK_OCF_INSUFFICIENT_PRIV:
ed0026
+        case PCMK_OCF_NOT_INSTALLED:
ed0026
+        case PCMK_OCF_INVALID_PARAM:
ed0026
             effective_node = node;
ed0026
             if(pe_can_fence(data_set, node) == FALSE
ed0026
                && safe_str_eq(task, CRMD_ACTION_STOP)) {
ed0026
                 /* If a stop fails and we can't fence, there's nothing else we can do */
ed0026
                 pe_proc_err("No further recovery can be attempted for %s: %s action failed with '%s' (%d)",
ed0026
-                            rsc->id, task, lrmd_event_rc2str(actual_rc_i), actual_rc_i);
ed0026
+                            rsc->id, task, services_ocf_exitcode_str(actual_rc_i), actual_rc_i);
ed0026
                 clear_bit(rsc->flags, pe_rsc_managed);
ed0026
                 set_bit(rsc->flags, pe_rsc_block);
ed0026
             }
ed0026
             /* fall through */
ed0026
-        case PCMK_EXECRA_NOT_CONFIGURED:
ed0026
+        case PCMK_OCF_NOT_CONFIGURED:
ed0026
             failed = rsc;
ed0026
             if (is_not_set(rsc->flags, pe_rsc_unique)) {
ed0026
                 failed = uber_parent(failed);
ed0026
             }
ed0026
 
ed0026
-            do_crm_log(actual_rc_i == PCMK_EXECRA_NOT_INSTALLED ? LOG_NOTICE : LOG_ERR,
ed0026
+            do_crm_log(actual_rc_i == PCMK_OCF_NOT_INSTALLED ? LOG_NOTICE : LOG_ERR,
ed0026
                        "Preventing %s from re-starting %s %s: operation %s failed '%s' (rc=%d)",
ed0026
                        failed->id,
ed0026
                        effective_node ? "on" : "anywhere in the cluster",
ed0026
                        effective_node ? effective_node->details->uname : "",
ed0026
-                       task, lrmd_event_rc2str(actual_rc_i), actual_rc_i);
ed0026
+                       task, services_ocf_exitcode_str(actual_rc_i), actual_rc_i);
ed0026
 
ed0026
             resource_location(failed, effective_node, -INFINITY, "hard-error", data_set);
ed0026
             if (is_probe) {
ed0026
@@ -2354,7 +2354,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
                 task = CRMD_ACTION_STOP;
ed0026
                 task_status_i = PCMK_LRM_OP_DONE;
ed0026
                 crm_xml_add(xml_op, XML_ATTR_UNAME, node->details->uname);
ed0026
-                if (actual_rc_i != PCMK_EXECRA_NOT_INSTALLED
ed0026
+                if (actual_rc_i != PCMK_OCF_NOT_INSTALLED
ed0026
                     || is_set(data_set->flags, pe_flag_symmetric_cluster)) {
ed0026
                     if ((node->details->shutdown == FALSE) || (node->details->online == TRUE)) {
ed0026
                         add_node_copy(data_set->failed, xml_op);
ed0026
@@ -2363,7 +2363,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
             }
ed0026
             break;
ed0026
 
ed0026
-        case PCMK_EXECRA_OK:
ed0026
+        case PCMK_OCF_OK:
ed0026
             if (is_probe && target_rc == 7) {
ed0026
                 task_status_i = PCMK_LRM_OP_DONE;
ed0026
                 pe_rsc_info(rsc, "Operation %s found resource %s active on %s",
ed0026
@@ -2447,7 +2447,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
         case PCMK_LRM_OP_DONE:
ed0026
             pe_rsc_trace(rsc, "%s/%s completed on %s", rsc->id, task, node->details->uname);
ed0026
 
ed0026
-            if (actual_rc_i == PCMK_EXECRA_NOT_RUNNING) {
ed0026
+            if (actual_rc_i == PCMK_OCF_NOT_RUNNING) {
ed0026
                 clear_past_failure = TRUE;
ed0026
 
ed0026
             } else if (safe_str_eq(task, CRMD_ACTION_STATUS)) {
ed0026
@@ -2519,7 +2519,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
                                      ID(migrate_from), migrate_target, from_status, from_rc);
ed0026
                     }
ed0026
 
ed0026
-                    if (migrate_from && from_rc == PCMK_EXECRA_OK
ed0026
+                    if (migrate_from && from_rc == PCMK_OCF_OK
ed0026
                         && from_status == PCMK_LRM_OP_DONE) {
ed0026
                         pe_rsc_trace(rsc, "Detected dangling migration op: %s on %s", ID(xml_op),
ed0026
                                      migrate_source);
ed0026
@@ -2603,7 +2603,7 @@ unpack_rsc_op(resource_t * rsc, node_t * node, xmlNode * xml_op,
ed0026
         case PCMK_LRM_OP_TIMEOUT:
ed0026
         case PCMK_LRM_OP_NOTSUPPORTED:
ed0026
             crm_warn("Processing failed op %s for %s on %s: %s (%d)",
ed0026
-                     task, rsc->id, node->details->uname, lrmd_event_rc2str(actual_rc_i),
ed0026
+                     task, rsc->id, node->details->uname, services_ocf_exitcode_str(actual_rc_i),
ed0026
                      actual_rc_i);
ed0026
             crm_xml_add(xml_op, XML_ATTR_UNAME, node->details->uname);
ed0026
             if ((node->details->shutdown == FALSE) || (node->details->online == TRUE)) {
ed0026
diff --git a/lib/services/systemd.c b/lib/services/systemd.c
ed0026
index 74cf53e..783caca 100644
ed0026
--- a/lib/services/systemd.c
ed0026
+++ b/lib/services/systemd.c
ed0026
@@ -381,10 +381,10 @@ systemd_unit_exec_done(GObject * source_object, GAsyncResult * res, gpointer use
ed0026
 
ed0026
             if (safe_str_eq(op->action, "stop")) {
ed0026
                 crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
ed0026
-                op->rc = PCMK_EXECRA_OK;
ed0026
+                op->rc = PCMK_OCF_OK;
ed0026
 
ed0026
             } else {
ed0026
-                op->rc = PCMK_EXECRA_NOT_INSTALLED;
ed0026
+                op->rc = PCMK_OCF_NOT_INSTALLED;
ed0026
             }
ed0026
 
ed0026
         } else {
ed0026
@@ -398,11 +398,11 @@ systemd_unit_exec_done(GObject * source_object, GAsyncResult * res, gpointer use
ed0026
         g_variant_get(_ret, "(o)", &path);
ed0026
         crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
ed0026
                  path);
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
 
ed0026
     } else {
ed0026
         crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
     }
ed0026
 
ed0026
     operation_finalize(op);
ed0026
@@ -423,7 +423,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
     const char *action = op->action;
ed0026
     char *name = systemd_service_name(op->agent);
ed0026
 
ed0026
-    op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+    op->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
     CRM_ASSERT(systemd_init());
ed0026
 
ed0026
     crm_debug("Performing %ssynchronous %s op on systemd unit %s named '%s'",
ed0026
@@ -431,7 +431,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
 
ed0026
     if (safe_str_eq(op->action, "meta-data")) {
ed0026
         op->stdout_data = systemd_unit_metadata(op->agent);
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
         goto cleanup;
ed0026
     }
ed0026
 
ed0026
@@ -440,7 +440,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
         crm_debug("Could not obtain unit named '%s': %s", op->agent,
ed0026
                   error ? error->message : "unknown");
ed0026
         if (error && strstr(error->message, "systemd1.NoSuchUnit")) {
ed0026
-            op->rc = PCMK_EXECRA_NOT_INSTALLED;
ed0026
+            op->rc = PCMK_OCF_NOT_INSTALLED;
ed0026
         }
ed0026
         if(error) {
ed0026
             g_error_free(error);
ed0026
@@ -452,9 +452,9 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
         char *state = systemd_unit_property(unit, BUS_NAME ".Unit", "ActiveState");
ed0026
 
ed0026
         if (g_strcmp0(state, "active") == 0) {
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
         } else {
ed0026
-            op->rc = PCMK_EXECRA_NOT_RUNNING;
ed0026
+            op->rc = PCMK_OCF_NOT_RUNNING;
ed0026
         }
ed0026
 
ed0026
         free(state);
ed0026
@@ -504,7 +504,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
     } else if (g_strcmp0(action, "restart") == 0) {
ed0026
         action = "RestartUnit";
ed0026
     } else {
ed0026
-        op->rc = PCMK_EXECRA_UNIMPLEMENT_FEATURE;
ed0026
+        op->rc = PCMK_OCF_UNIMPLEMENT_FEATURE;
ed0026
         goto cleanup;
ed0026
     }
ed0026
 
ed0026
@@ -525,7 +525,7 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
         if (safe_str_eq(op->action, "stop")
ed0026
             && strstr(error->message, "systemd1.InvalidName")) {
ed0026
             crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
         } else {
ed0026
             crm_err("Could not issue %s for %s: %s (%s)", action, op->rsc, error->message, unit);
ed0026
         }
ed0026
@@ -537,11 +537,11 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
         g_variant_get(_ret, "(o)", &path);
ed0026
         crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
ed0026
                  path);
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
 
ed0026
     } else {
ed0026
         crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
     }
ed0026
 
ed0026
   cleanup:
ed0026
@@ -555,5 +555,5 @@ systemd_unit_exec(svc_action_t * op, gboolean synchronous)
ed0026
         operation_finalize(op);
ed0026
         return TRUE;
ed0026
     }
ed0026
-    return op->rc == PCMK_EXECRA_OK;
ed0026
+    return op->rc == PCMK_OCF_OK;
ed0026
 }
ed0026
diff --git a/lib/services/upstart.c b/lib/services/upstart.c
ed0026
index f5fa189..daeb398 100644
ed0026
--- a/lib/services/upstart.c
ed0026
+++ b/lib/services/upstart.c
ed0026
@@ -384,12 +384,12 @@ upstart_job_exec_done(GObject * source_object, GAsyncResult * res, gpointer user
ed0026
         if (safe_str_eq(op->action, "start")
ed0026
             && strstr(error->message, BUS_MANAGER_IFACE ".Error.AlreadyStarted")) {
ed0026
             crm_trace("Masking Start failure for %s: already started", op->rsc);
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
 
ed0026
         } else if (safe_str_eq(op->action, "stop")
ed0026
                    && strstr(error->message, BUS_MANAGER_IFACE ".Error.UnknownInstance")) {
ed0026
             crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
         } else {
ed0026
             crm_err("Could not issue %s for %s: %s", op->action, op->rsc, error->message);
ed0026
         }
ed0026
@@ -401,11 +401,11 @@ upstart_job_exec_done(GObject * source_object, GAsyncResult * res, gpointer user
ed0026
         g_variant_get(_ret, "(o)", &path);
ed0026
         crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
ed0026
                  path);
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
 
ed0026
     } else {
ed0026
         crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
     }
ed0026
 
ed0026
     operation_finalize(op);
ed0026
@@ -427,12 +427,12 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
ed0026
     GVariant *_ret = NULL;
ed0026
     GDBusProxy *job_proxy = NULL;
ed0026
 
ed0026
-    op->rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+    op->rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
     CRM_ASSERT(upstart_init());
ed0026
 
ed0026
     if (safe_str_eq(op->action, "meta-data")) {
ed0026
         op->stdout_data = upstart_job_metadata(op->agent);
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
         goto cleanup;
ed0026
     }
ed0026
 
ed0026
@@ -443,18 +443,18 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
ed0026
     }
ed0026
     if (pass == FALSE) {
ed0026
         if (!g_strcmp0(action, "stop")) {
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
         } else {
ed0026
-            op->rc = PCMK_EXECRA_NOT_INSTALLED;
ed0026
+            op->rc = PCMK_OCF_NOT_INSTALLED;
ed0026
         }
ed0026
         goto cleanup;
ed0026
     }
ed0026
 
ed0026
     if (safe_str_eq(op->action, "monitor") || safe_str_eq(action, "status")) {
ed0026
         if (upstart_job_running(op->agent)) {
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
         } else {
ed0026
-            op->rc = PCMK_EXECRA_NOT_RUNNING;
ed0026
+            op->rc = PCMK_OCF_NOT_RUNNING;
ed0026
         }
ed0026
         goto cleanup;
ed0026
 
ed0026
@@ -465,7 +465,7 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
ed0026
     } else if (!g_strcmp0(action, "restart")) {
ed0026
         action = "Restart";
ed0026
     } else {
ed0026
-        op->rc = PCMK_EXECRA_UNIMPLEMENT_FEATURE;
ed0026
+        op->rc = PCMK_OCF_UNIMPLEMENT_FEATURE;
ed0026
         goto cleanup;
ed0026
     }
ed0026
 
ed0026
@@ -487,11 +487,11 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
ed0026
         if (safe_str_eq(action, "Start")
ed0026
             && strstr(error->message, BUS_MANAGER_IFACE ".Error.AlreadyStarted")) {
ed0026
             crm_trace("Masking Start failure for %s: already started", op->rsc);
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
         } else if (safe_str_eq(action, "Stop")
ed0026
                    && strstr(error->message, BUS_MANAGER_IFACE ".Error.UnknownInstance")) {
ed0026
             crm_trace("Masking Stop failure for %s: unknown services are stopped", op->rsc);
ed0026
-            op->rc = PCMK_EXECRA_OK;
ed0026
+            op->rc = PCMK_OCF_OK;
ed0026
         } else {
ed0026
             crm_err("Could not issue %s for %s: %s (%s)", action, op->rsc, error->message, job);
ed0026
         }
ed0026
@@ -502,11 +502,11 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
ed0026
         g_variant_get(_ret, "(o)", &path);
ed0026
         crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret),
ed0026
                  path);
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
 
ed0026
     } else {
ed0026
         crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret));
ed0026
-        op->rc = PCMK_EXECRA_OK;
ed0026
+        op->rc = PCMK_OCF_OK;
ed0026
     }
ed0026
 
ed0026
   cleanup:
ed0026
@@ -524,5 +524,5 @@ upstart_job_exec(svc_action_t * op, gboolean synchronous)
ed0026
         operation_finalize(op);
ed0026
         return TRUE;
ed0026
     }
ed0026
-    return op->rc == PCMK_EXECRA_OK;
ed0026
+    return op->rc == PCMK_OCF_OK;
ed0026
 }
ed0026
diff --git a/lrmd/lrmd.c b/lrmd/lrmd.c
ed0026
index b5bbea0..8592b6c 100644
ed0026
--- a/lrmd/lrmd.c
ed0026
+++ b/lrmd/lrmd.c
ed0026
@@ -460,38 +460,38 @@ static int
ed0026
 lsb2uniform_rc(const char *action, int rc)
ed0026
 {
ed0026
     if (rc < 0) {
ed0026
-        return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+        return PCMK_OCF_UNKNOWN_ERROR;
ed0026
     }
ed0026
 
ed0026
     /* status has different return codes that everything else. */
ed0026
     if (!safe_str_eq(action, "status") && !safe_str_eq(action, "monitor")) {
ed0026
         if (rc > PCMK_LSB_NOT_RUNNING) {
ed0026
-            return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+            return PCMK_OCF_UNKNOWN_ERROR;
ed0026
         }
ed0026
         return rc;
ed0026
     }
ed0026
 
ed0026
     switch (rc) {
ed0026
         case PCMK_LSB_STATUS_OK:
ed0026
-            return PCMK_EXECRA_OK;
ed0026
+            return PCMK_OCF_OK;
ed0026
         case PCMK_LSB_STATUS_NOT_INSTALLED:
ed0026
-            return PCMK_EXECRA_NOT_INSTALLED;
ed0026
+            return PCMK_OCF_NOT_INSTALLED;
ed0026
         case PCMK_LSB_STATUS_VAR_PID:
ed0026
         case PCMK_LSB_STATUS_VAR_LOCK:
ed0026
         case PCMK_LSB_STATUS_NOT_RUNNING:
ed0026
-            return PCMK_EXECRA_NOT_RUNNING;
ed0026
+            return PCMK_OCF_NOT_RUNNING;
ed0026
         default:
ed0026
-            return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+            return PCMK_OCF_UNKNOWN_ERROR;
ed0026
     }
ed0026
 
ed0026
-    return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+    return PCMK_OCF_UNKNOWN_ERROR;
ed0026
 }
ed0026
 
ed0026
 static int
ed0026
 ocf2uniform_rc(int rc)
ed0026
 {
ed0026
     if (rc < 0 || rc > PCMK_OCF_FAILED_MASTER) {
ed0026
-        return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+        return PCMK_OCF_UNKNOWN_ERROR;
ed0026
     }
ed0026
 
ed0026
     return rc;
ed0026
@@ -502,14 +502,14 @@ stonith2uniform_rc(const char *action, int rc)
ed0026
 {
ed0026
     if (rc == -ENODEV) {
ed0026
         if (safe_str_eq(action, "stop")) {
ed0026
-            rc = PCMK_EXECRA_OK;
ed0026
+            rc = PCMK_OCF_OK;
ed0026
         } else if (safe_str_eq(action, "start")) {
ed0026
-            rc = PCMK_EXECRA_NOT_INSTALLED;
ed0026
+            rc = PCMK_OCF_NOT_INSTALLED;
ed0026
         } else {
ed0026
-            rc = PCMK_EXECRA_NOT_RUNNING;
ed0026
+            rc = PCMK_OCF_NOT_RUNNING;
ed0026
         }
ed0026
     } else if (rc != 0) {
ed0026
-        rc = PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+        rc = PCMK_OCF_UNKNOWN_ERROR;
ed0026
     }
ed0026
     return rc;
ed0026
 }
ed0026
@@ -519,25 +519,25 @@ static int
ed0026
 nagios2uniform_rc(const char *action, int rc)
ed0026
 {
ed0026
     if (rc < 0) {
ed0026
-        return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+        return PCMK_OCF_UNKNOWN_ERROR;
ed0026
     }
ed0026
 
ed0026
     switch (rc) {
ed0026
         case NAGIOS_STATE_OK:
ed0026
-            return PCMK_EXECRA_OK;
ed0026
+            return PCMK_OCF_OK;
ed0026
         case NAGIOS_INSUFFICIENT_PRIV:
ed0026
-            return PCMK_EXECRA_INSUFFICIENT_PRIV;
ed0026
+            return PCMK_OCF_INSUFFICIENT_PRIV;
ed0026
         case NAGIOS_NOT_INSTALLED:
ed0026
-            return PCMK_EXECRA_NOT_INSTALLED;
ed0026
+            return PCMK_OCF_NOT_INSTALLED;
ed0026
         case NAGIOS_STATE_WARNING:
ed0026
         case NAGIOS_STATE_CRITICAL:
ed0026
         case NAGIOS_STATE_UNKNOWN:
ed0026
         case NAGIOS_STATE_DEPENDENT:
ed0026
         default:
ed0026
-            return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+            return PCMK_OCF_UNKNOWN_ERROR;
ed0026
     }
ed0026
 
ed0026
-    return PCMK_EXECRA_UNKNOWN_ERROR;
ed0026
+    return PCMK_OCF_UNKNOWN_ERROR;
ed0026
 }
ed0026
 #endif
ed0026
 
ed0026
@@ -605,11 +605,11 @@ action_complete(svc_action_t * action)
ed0026
 #if SUPPORT_NAGIOS
ed0026
     if (rsc && safe_str_eq(rsc->class, "nagios")) {
ed0026
         if (safe_str_eq(cmd->action, "monitor") &&
ed0026
-            cmd->interval == 0 && cmd->exec_rc == PCMK_EXECRA_OK) {
ed0026
+            cmd->interval == 0 && cmd->exec_rc == PCMK_OCF_OK) {
ed0026
             /* Successfully executed --version for the nagios plugin */
ed0026
-            cmd->exec_rc = PCMK_EXECRA_NOT_RUNNING;
ed0026
+            cmd->exec_rc = PCMK_OCF_NOT_RUNNING;
ed0026
 
ed0026
-        } else if (safe_str_eq(cmd->action, "start") && cmd->exec_rc != PCMK_EXECRA_OK) {
ed0026
+        } else if (safe_str_eq(cmd->action, "start") && cmd->exec_rc != PCMK_OCF_OK) {
ed0026
             int time_sum = 0;
ed0026
             int timeout_left = 0;
ed0026
             int delay = cmd->timeout_orig / 10;
ed0026
@@ -841,7 +841,7 @@ lrmd_rsc_execute_service_lib(lrmd_rsc_t * rsc, lrmd_cmd_t * cmd)
ed0026
 #if SUPPORT_NAGIOS
ed0026
     /* Recurring operations are cancelled anyway for a stop operation */
ed0026
     if (safe_str_eq(rsc->class, "nagios") && safe_str_eq(cmd->action, "stop")) {
ed0026
-        cmd->exec_rc = PCMK_EXECRA_OK;
ed0026
+        cmd->exec_rc = PCMK_OCF_OK;
ed0026
         goto exec_done;
ed0026
     }
ed0026
 #endif
ed0026
diff --git a/lrmd/test.c b/lrmd/test.c
ed0026
index 15ffd88..2d8571e 100644
ed0026
--- a/lrmd/test.c
ed0026
+++ b/lrmd/test.c
ed0026
@@ -110,7 +110,7 @@ test_exit(int rc)
ed0026
              lrmd_event_type2str(event->type),                          \
ed0026
              event->rsc_id,                                             \
ed0026
              event->op_type ? event->op_type : "none",                  \
ed0026
-             lrmd_event_rc2str(event->rc),                              \
ed0026
+             services_ocf_exitcode_str(event->rc),                              \
ed0026
              services_lrm_status_str(event->op_status));                \
ed0026
     crm_info("%s", event_buf_v0);;
ed0026
 
ed0026
diff --git a/pengine/native.c b/pengine/native.c
ed0026
index 37f5211..21ad629 100644
ed0026
--- a/pengine/native.c
ed0026
+++ b/pengine/native.c
ed0026
@@ -23,6 +23,7 @@
ed0026
 #include <crm/msg_xml.h>
ed0026
 #include <allocate.h>
ed0026
 #include <utils.h>
ed0026
+#include <crm/services.h>
ed0026
 
ed0026
 /* #define DELETE_THEN_REFRESH 1  // The crmd will remove the resource from the CIB itself, making this redundant */
ed0026
 #define INFINITY_HACK   (INFINITY * -100)
ed0026
@@ -783,7 +784,7 @@ RecurringOp(resource_t * rsc, action_t * start, node_t * node,
ed0026
     }
ed0026
 
ed0026
     if (rsc->next_role == RSC_ROLE_MASTER) {
ed0026
-        char *running_master = crm_itoa(PCMK_EXECRA_RUNNING_MASTER);
ed0026
+        char *running_master = crm_itoa(PCMK_OCF_RUNNING_MASTER);
ed0026
 
ed0026
         add_hash_param(mon->meta, XML_ATTR_TE_TARGET_RC, running_master);
ed0026
         free(running_master);
ed0026
@@ -949,7 +950,7 @@ RecurringOp_Stopped(resource_t * rsc, action_t * start, node_t * node,
ed0026
 
ed0026
         stopped_mon = custom_action(rsc, strdup(key), name, stop_node, is_optional, TRUE, data_set);
ed0026
 
ed0026
-        rc_inactive = crm_itoa(PCMK_EXECRA_NOT_RUNNING);
ed0026
+        rc_inactive = crm_itoa(PCMK_OCF_NOT_RUNNING);
ed0026
         add_hash_param(stopped_mon->meta, XML_ATTR_TE_TARGET_RC, rc_inactive);
ed0026
         free(rc_inactive);
ed0026
 
ed0026
@@ -2400,8 +2401,8 @@ native_create_probe(resource_t * rsc, node_t * node, action_t * complete,
ed0026
     static const char *rc_inactive = NULL;
ed0026
 
ed0026
     if (rc_inactive == NULL) {
ed0026
-        rc_inactive = crm_itoa(PCMK_EXECRA_NOT_RUNNING);
ed0026
-        rc_master = crm_itoa(PCMK_EXECRA_RUNNING_MASTER);
ed0026
+        rc_inactive = crm_itoa(PCMK_OCF_NOT_RUNNING);
ed0026
+        rc_master = crm_itoa(PCMK_OCF_RUNNING_MASTER);
ed0026
     }
ed0026
 
ed0026
     CRM_CHECK(node != NULL, return FALSE);
ed0026
diff --git a/tools/crm_mon.c b/tools/crm_mon.c
ed0026
index 9d68237..7c6e495 100644
ed0026
--- a/tools/crm_mon.c
ed0026
+++ b/tools/crm_mon.c
ed0026
@@ -950,7 +950,7 @@ print_rsc_history(pe_working_set_t * data_set, node_t * node, xmlNode * rsc_entr
ed0026
             }
ed0026
         }
ed0026
 
ed0026
-        print_as(" rc=%s (%s)\n", op_rc, lrmd_event_rc2str(rc));
ed0026
+        print_as(" rc=%s (%s)\n", op_rc, services_ocf_exitcode_str(rc));
ed0026
     }
ed0026
 
ed0026
     /* no need to free the contents */
ed0026
@@ -1405,11 +1405,11 @@ print_status(pe_working_set_t * data_set)
ed0026
                 }
ed0026
 
ed0026
                 print_as("    %s on %s '%s' (%d): call=%s, status=%s, last-rc-change='%s', queued=%sms, exec=%sms\n",
ed0026
-                         op_key ? op_key : id, node, lrmd_event_rc2str(rc), rc, call, services_lrm_status_str(status),
ed0026
+                         op_key ? op_key : id, node, services_ocf_exitcode_str(rc), rc, call, services_lrm_status_str(status),
ed0026
                          run_at_s, crm_element_value(xml_op, XML_RSC_OP_T_EXEC), crm_element_value(xml_op, XML_RSC_OP_T_QUEUE));
ed0026
             } else {
ed0026
                 print_as("    %s on %s '%s' (%d): call=%s, status=%s\n",
ed0026
-                         op_key ? op_key : id, node, lrmd_event_rc2str(rc), rc, call, services_lrm_status_str(status));
ed0026
+                         op_key ? op_key : id, node, services_ocf_exitcode_str(rc), rc, call, services_lrm_status_str(status));
ed0026
             }
ed0026
         }
ed0026
         print_as("\n");
ed0026
@@ -2135,10 +2135,10 @@ send_smtp_trap(const char *node, const char *rsc, const char *task, int target_r
ed0026
                     "\toperation status: (%d) %s\r\n", status, services_lrm_status_str(status));
ed0026
     if (status == PCMK_LRM_OP_DONE) {
ed0026
         len += snprintf(crm_mail_body + len, BODY_MAX - len,
ed0026
-                        "\tscript returned: (%d) %s\r\n", rc, lrmd_event_rc2str(rc));
ed0026
+                        "\tscript returned: (%d) %s\r\n", rc, services_ocf_exitcode_str(rc));
ed0026
         len += snprintf(crm_mail_body + len, BODY_MAX - len,
ed0026
                         "\texpected return value: (%d) %s\r\n", target_rc,
ed0026
-                        lrmd_event_rc2str(target_rc));
ed0026
+                        services_ocf_exitcode_str(target_rc));
ed0026
     }
ed0026
 
ed0026
     auth_client_init();
ed0026
@@ -2274,12 +2274,12 @@ handle_rsc_op(xmlNode * rsc_op)
ed0026
     desc = pcmk_strerror(pcmk_ok);
ed0026
     if (status == PCMK_LRM_OP_DONE && target_rc == rc) {
ed0026
         crm_notice("%s of %s on %s completed: %s", task, rsc, node, desc);
ed0026
-        if (rc == PCMK_EXECRA_NOT_RUNNING) {
ed0026
+        if (rc == PCMK_OCF_NOT_RUNNING) {
ed0026
             notify = FALSE;
ed0026
         }
ed0026
 
ed0026
     } else if (status == PCMK_LRM_OP_DONE) {
ed0026
-        desc = lrmd_event_rc2str(rc);
ed0026
+        desc = services_ocf_exitcode_str(rc);
ed0026
         crm_warn("%s of %s on %s failed: %s", task, rsc, node, desc);
ed0026
 
ed0026
     } else {