ClusterLabs/resource-agents — pull request #465 by davidvossel (2014-07-22 18:34:37+00:00)
Title: Ability to pass exit reason string on stderr to cluster manager

Previously, we had no way of communicating a reason for why a resource failure occurred other than requiring users to parse though a log file for the relevant OCF agent error message. Cluster managers (like pacemaker) have the ability to output the cluster's status and display failed actions. A common complaint is that those status tools don't have the ability to tell us anything more than what the OCF return code was.

These patches provide the ability to pass an exit reason string back to the cluster resource manager over stderr. This is accomplished by using a delimiter string (cookie) as a postfix to the exit string in the stderr output. When processing the stderr output of an agent, any string values occurring after the cookie are considered to be a part of the exit reason string.

The exit reason cookie is a defined value that the resource-agent's package exports in the agent_config.h file. This allows Pacemaker to use the cookie delimiter as it is exported from the resource-agents package.