Managing Serviceguard Fifteenth Edition, reprinted May 2008

Planning and Documenting an HA Cluster
Package Configuration Planning
Chapter 4190
You can add custom code to the package to interrogate this variable,
determine why the package halted, and take appropriate action. For
legacy packages, put the code in the customer_defined_halt_cmds()
function in the CUSTOMER DEFINED FUNCTIONS area of the package
control script (see “Adding Customer Defined Functions to the Package
Control Script” on page 385); for modular packages, put the code in the
package’s external script (see “About External Scripts” on page 185).
For example, if a database package is being halted by an administrator
(SG_HALT_REASON set to user_halt) you would probably want the custom
code to perform an orderly shutdown of the database; on the other hand,
a forced shutdown might be needed if SG_HALT_REASON is set to failure,
indicating that the package is halting abnormally (for example because
of the failure of a service it depends on).
last_halt_failed cmviewcl -v -f line displays a last_halt_failed
flag.
NOTE last_halt_failed appears only in the line output of cmviewcl, not the
default tabular format; you must use the -v and -f line options to see
it.
The value of last_halt_failed is no if the halt script ran successfully,
or was not run since the node joined the cluster, or was not run since the
package was configured to run on the node; otherwise it is yes.