For the first point, in fact I've modified :
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
as 
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat}
. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs
because on my system (RH) , there is only one ocf-shellfuncs (without the 
".") here :
/usr/share/cluster/ocf-shellfuncs , so that's why the script does not find 
this
file ocf-shellfuncs under ${OCF_ROOT}/lib/heartbeat}

Alain



De :    [email protected]
A :     [email protected]
Date :  26/07/2012 16:49
Objet : [Linux-HA] tuning of ocf script exportfs
Envoyé par :    [email protected]



Hi Dejan

a little contribution on the script exportfs , last release found here 
(delivered 16 days ago):
https://github.com/ClusterLabs/resource-agents/tree/master/heartbeat

two things except if I'm mistaking:

1/ little typo :  I think the "." is missing for .ocf-shellfuncs

2/ the script does not work if we set the OCF_RESKEY_clientspec="*" in 
params of the exportfs resource, 

due to the exportfs_monitor function : 
when using * instead of hostname, the exportfs is displaying for example :
/alain <world>
and the line :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t; 
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' |  grep -q -x -F 

"${OCF_RESKEY_directory} ${OCF_RESKEY_clientspec}"
returns 1 and then $OCF_NOT_RUNNING

So I don't know if it is the more elegant manner to fix this little issue, 

but I've added at the begining of exportfs_monitor : 

exportfs_monitor ()
{
        # exportfs output wraps lines for long export directory names.
        # We unwrap here with sed.
        # We then do a literal match on the full line (grep -x -F)
        if [ "${OCF_RESKEY_clientspec}" == "*" ]; then
                CLIENTSPEC="<world>"
        else
                CLIENTSPEC=${OCF_RESKEY_clientspec}
        fi

and use $CLIENTSPEC on the grep :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t; 
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' |  grep -q -x -F 

"${OCF_RESKEY_directory} ${CLIENTSPEC} 

With this tuning, it works fine.

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

_______________________________________________
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