LSB Resource Agents

Background
LSB Resource Agents are those found in. Generally they are provided by the OS/distribution and in order to be used with Heartbeat or Pacemaker resource management, must conform to the LSB Spec.

The LSB Spec (as it relates to init scripts) can be found at: http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

Many distributions claim LSB compliance but ship with broken init scripts. The most common problems are:
 * Not implementing the status operation at all
 * Not observing the correct exit status codes for start/stop/status actions
 * Starting a started resource returns an error (this violates the LSB spec)
 * Stopping a stopped resource returns an error (this violates the LSB spec)
 * This may also result in "ERROR: reboot narrowly avoided" messages by heartbeat, or, if the status operation is poorly implemented as well, in actual reboots, to "recover" from "stop failure".

NOTE: Parameters and options can not be passed to LSB Resource Agents.

Init Script (LSB) Compatibility Checks
Assuming some_service is configured correctly and currently not active, the following sequence will help you determine if it is LSB compatible:
 * 1) Start (stopped)
 * 2) * Did the service start?
 * 3) * Did the command print  (in addition to the regular output)?
 * 4) Status (running)
 * 5) * Did the script accept the command?
 * 6) * Did the script indicate the service was running?
 * 7) * Did the command print  (in addition to the regular output)?
 * 8) Start (running)
 * 9) * Is the service still running?
 * 10) * Did the command print  (in addition to the regular output)?
 * 11) Stop (running)
 * 12) * Was the service stopped?
 * 13) * Did the command print  (in addition to the regular output)?
 * 14) Status (stopped)
 * 15) * Did the script accept the command?
 * 16) * Did the script indicate the service was not running?
 * 17) * Did the command print  (in addition to the regular output)?
 * 18) Stop (stopped)
 * 19) * Is the service still stopped?
 * 20) * Did the command print  (in addition to the regular output)?
 * 21) Status (failed)
 * This step is not readily testable and relies on manual inspection of the script.
 * The script can optionally use one of the other codes (other than 3) listed in the LSB spec to indicate that it is active but failed.
 * In such a case, this tells the cluster that, before moving the resource to another node, it should stop it on the existing one first.
 * Making use of these extra exit codes is encouraged.
 * 1) * Did the command print  (in addition to the regular output)?
 * 2) Status (failed)
 * This step is not readily testable and relies on manual inspection of the script.
 * The script can optionally use one of the other codes (other than 3) listed in the LSB spec to indicate that it is active but failed.
 * In such a case, this tells the cluster that, before moving the resource to another node, it should stop it on the existing one first.
 * Making use of these extra exit codes is encouraged.

If the answer to any of the above questions is no, then the init script is not LSB compliant.

If you are using Pacemaker resource management, then your options at this point are to:
 * fix the init script, or
 * write an OCF Resource Agent based on the existing init script

If you are still using the haresources mode of Heartbeat, then the script may still work as long as it follows the rules for Heartbeat Resource Agents.