[Linux-HA] What should 'monitor' do?

Lars Marowsky-Bree lmb at suse.de
Wed Oct 5 15:30:12 MDT 2005


On 2005-10-06T00:38:33, "Sun, Xun" <outfox at sjtu.edu.cn> wrote:

> Hi Adam,
> ???2005???10???05??????21:52???Adam Moffett?????????
> > If I create a resource script with a monitor action, what should it 
> > report when asked to 'monitor'?
> 
> Do you mean ocf resource script? If so, the only thing that matters is
> the return code. All your 'monitor' operation needs to do is:
> 
> If resource is working, then
> 	return $OCF_SUCCESS
> else
> 	return $OCF_NOT_RUNNING

Sorry, this is dangerously wrong.

$OCF_NOT_RUNNING should only be returned if the resource is CLEANLY
stopped. If you return this for failed states, you'll confuse some
recovery processes.

Return $OCF_ERR_GENERIC if in doubt; ocf-shellfuncs defines some more
exit codes (which also means this file needs to be sourced before the
exit codes can be returned), which are described in the OCF RA API
specification.


Sincerely,
    Lars Marowsky-Brée <lmb at suse.de>

-- 
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business	 -- Charles Darwin
"Ignorance more frequently begets confidence than does knowledge"




More information about the Linux-HA mailing list