[ClusterLabs] Coming in Pacemaker 2.0.0: Reliable exit codes

Ken Gaillot kgaillot at redhat.com
Wed Jan 10 17:22:21 EST 2018

Every time you run a command on the command line or in a script, it
returns an exit status. These are most useful in scripts to check for

Currently, Pacemaker daemons and command-line tools return an
unreliable mishmash of exit status codes, sometimes including negative
numbers (which get bitwise-remapped to the 0-255 range) and/or C
library errno codes (which can vary across OSes).

The only thing scripts could rely on was 0 means success and nonzero
means error.

Beginning with Pacemaker 2.0.0, everything will return a well-defined
set of reliable exit status codes. These codes can be viewed using the
existing crm_error tool using the --exit parameter. For example:

    crm_error --exit --list

will list all possible exit statuses, and

    crm_error --exit 124

will show a textual description of what exit status 124 means.

This will mainly be of interest to users who script Pacemaker commands
and check the return value. If your scripts rely on the current exit
codes, you may need to update your scripts for 2.0.0.
Ken Gaillot <kgaillot at redhat.com>

More information about the Users mailing list