The cluster starts, stops, and monitors each resource agent running in the cluster. Actions and failures return codes to provide more information. Each action has specific exit codes that it must return. The cluster software always checks the return code against the expected result. If the result does not match the expected value, then the operation is deemed to have failed and a recovery action is initiated.
Refer to the following table for a list of common return codes, their meaning, the type of failure, and the action taken by the cluster. The “rc” codes are numeric but map to an OCF Alias as shown in the table.
Table 1. Common OCF Return Codes
RC | OCF Alias | Description | Return Type | Action Taken by Cluster |
---|---|---|---|---|
0 | OCF_SUCCESS | Success. The command completed successfully. This is the expected result for all start, stop, promote, and demote commands. | Soft | N/A. |
1 | OCF_ERR_GENERIC | Generic “there was a problem” error code. | Soft (Transient error occurred.) | Restart the resource or move it to a new location. |
2 | OCF_ERR_ARGS | The configuration of the resource is not valid on this machine. (For example, refers to a location/tool not found on the node.) | Hard (Nontransient error occurred that might be specific to current node.) | Move the resource elsewhere; prevent retrying it on current node. |
3 | OCF_ERR_UNIMPLEMENTED | The requested action is not implemented. | Hard (Nontransient error occurred that might be specific to current node.) | Move the resource elsewhere; prevent retrying it on current node. |
4 | OCF_ERR_PERM | The resource agent does not have sufficient privileges to complete the task. | Hard (Nontransient error occurred that might be specific to current node.) | Move the resource elsewhere; prevent retrying it on current node. |
5 | OCF_ERR_INSTALLED | The tools required by the resource are not installed on this machine. | Hard (Nontransient error occurred that might be specific to current node.) | Move the resource elsewhere; prevent retrying it on current node. |
6 | OCF_ERR_CONFIGURED | The configuration of the resource is invalid. (For example, required parameters are missing.) | Fatal (Nontransient error occurred that is common to all cluster nodes, meaning a bad configuration was specified. | Stop the resource and prevent it being started on any cluster node. |
7 | OCF_NOT_RUNNING | The resource is safely stopped. The cluster will not attempt to stop a resource that returns this code for any action. | N/A | |
8 | OCF_RUNNING_MASTER | The resource is running in Master mode. | Soft | N/A |
9 | OCF_FAILED_MASTER | The resource is in Master mode but has failed. The resource will be demoted, stopped, and then started (and possibly promoted again). | Soft (Transient error occurred.) | Restart the resource or move it to a new location. |