On Friday 19 March 2010 15:27:17 Ivan Gromov wrote:
> Dear all,
> 
> Could you explain me what the command ocf_run is? Where can I find
> documentation on it and its sources?
> 
> 
> --
> Thanks in advance,
> Ivan
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
> 

ocf_run is found in .ocf-shellfuncs which is part of the resource-agents 
package.

this is the code of the function:

ocf_run() {                                 
        output=`"$@" 2>&1`                  
        rc=$?                               
        output=`echo $output`               
        if [ $rc -eq 0 ]; then              
            if [ ! -z "$output" ]; then     
                ocf_log info "$output"      
            fi                              
            return $OCF_SUCCESS             
        else                                
            if [ ! -z "$output" ]; then     
                ocf_log err "$output"       
            else                            
                ocf_log err "command failed: $*"
            fi                                  
            return $OCF_ERR_GENERIC             
        fi                                      
} 

I think it is self explanatory.

-- 
Best regards,
Marian Marinov

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to