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

Reply via email to