[OCF] ocf-shellfuncs standardization - Comments? Objections?

Alan Robertson alanr at unix.sh
Sat Jun 18 20:50:40 MDT 2005


Hi,

We have an ocf-shellfuncs which has various things in it, and which is 
believed to sort-of conform to the RA spec we wrote before.

It defines some variables which we had mostly agreed upon, and a 
function, which I can't find any reference for us every finalizing on in 
the spec, or on the mailing list.

The function is ocf_log - which (as written) takes at least two arguments:

   1:   severity
   2-n: message text

The code we have provides for the following severities, and allows others:

    crit         CRIT level message
    err		ERROR level message
    warn		WARNING level message
    info		INFO level message
    debug	DEBUG level message

The variables we define are:
         OCF_SUCCESS=0
         OCF_ERR_GENERIC=1
         OCF_ERR_ARGS=2
         OCF_ERR_UNIMPLEMENTED=3
         OCF_ERR_PERM=4
         OCF_ERR_INSTALLED=5
         OCF_ERR_CONFIGURED=6
         OCF_NOT_RUNNING=7

         OCF_CHECK_LEVEL
         OCF_ROOT
         OCF_RESOURCE_TYPE
         OCF_RESOURCE_INSTANCE

         OCF_RA_VERSION_MAJOR
         OCF_RA_VERSION_MINOR

I think all these variables were defined in the spec, but the ocf_log 
function was not.  We talked around it, but we never talked about it.

It clearly needs to be part of the RA spec - since you shouldn't write 
an RA without it...

[In practice, we also set a number of other variables, but they all 
start with _OCF something.  I think should treat _OCF prefixes as 
reserved, so that no one conflicts with them, nor will any conforming RA 
ever use or depend on them].

In our implementation, all but the last two are ALWAYS set or defaulted 
to something reasonable, and ocf_log always does something reasonable 
(like syslog) - even when not invoked from a cluster.

This is to allow RAs to also serve as init scripts.  In the init script 
case, the OCF_RA_VERSION* variables will NOT be set - which is how a 
script would detect they're being invoked outside the cluster environment.

What are people's thoughts on these things?

We need standards in these areas.  Any general objections to the ones 
described above?

I can write it up in more detail, if there's general agreement...



-- 
     Alan Robertson <alanr at unix.sh>

"Openness is the foundation and preservative of friendship...  Let me 
claim from you at all times your undisguised opinions." - William 
Wilberforce


More information about the OCF mailing list