Bug 691814 - nfsclient exports doens't work.
Summary: nfsclient exports doens't work.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Lon Hohberger
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 592624
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-29 14:27 UTC by Lon Hohberger
Modified: 2011-12-06 12:02 UTC (History)
8 users (show)

Fixed In Version: resource-agents-3.9.1-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 592624
Environment:
Last Closed: 2011-12-06 12:02:45 UTC
Target Upstream Version:


Attachments (Terms of Use)
Test (1.00 KB, text/plain)
2011-06-29 13:59 UTC, Lon Hohberger
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1580 0 normal SHIPPED_LIVE Low: resource-agents security, bug fix, and enhancement update 2011-12-06 00:38:57 UTC

Description Lon Hohberger 2011-03-29 14:27:39 UTC
+++ This bug was initially created as a clone of Bug #592624 +++

Description of problem:

The monitoring of the nfsexports to nfsclinents goes in to an endless loop. See attached syslog.

When using inheritance in the cluster.conf it looks like /usr/share/cluster/nfsclient.sh can't monitor the export properly.

Problem #1: /var/lib/nfs/etab doesn't have a slash '/' at the end of the export path. Yet $OCF_RESKEY_path contains the end slash '/'. When checking if the export is present in:

  cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
                "^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_tmp}"
        rv=$?
It doesn't match you try to match:


/nfsexport/lv_app               bamse.niceriver.net

with 

^/nfsexport/lv_app/[\t ]*.*bamse.niceriver.net

No so the monitor is exiting with 1 and the whole thing error out.


Problem #2: Ip doesn't work in the target well you try to make it work here.

declare OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target")

but the fact is that the /var/lib/nfs/etab actually contain the IP address so then it's a no go again due to a miss match..


Anyways here is a version that will work :).. for both IP and hostnames as well as with or without ending '/' -- yes could be more brain behind the regexp but I just made it simple.. 


        declare OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target")
        if [ $? -ne 0 ]; then
                [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
                ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
                exit 1
        fi

        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
                "^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_tmp}"
        rv=$?

        if [ $rv -eq 0 ]; then
                [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
                exit 0
        fi

        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
                "^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target}"
        rv=$?

        if [ $rv -eq 0 ]; then
                [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
                exit 0
        fi

        OCF_RESKEY_path_tmp=$(echo $OCF_RESKEY_path | sed -e 's@/$@@')

        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
                "^${OCF_RESKEY_path_tmp}[\t ]*.*${OCF_RESKEY_target_tmp}"
        rv=$?

        if [ $rv -eq 0 ]; then
                [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
                exit 0
        fi

        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
                "^${OCF_RESKEY_path_tmp}[\t ]*.*${OCF_RESKEY_target}"
        rv=$?

        [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
        if [ $rv -eq 0 ]; then
                exit 0
        fi


        ocf_log err "nfsclient:$OCF_RESKEY_name is missing! at end"
        exit 1
        ;;

--- Additional comment from lhh on 2011-03-28 16:44:48 EDT ---

Created attachment 488253 [details]
Fixes problem #1.

--- Additional comment from lhh on 2011-03-28 16:45:58 EDT ---

Problem #2 is fixed by the fix for bug 592613

Comment 1 Nate Straz 2011-05-24 13:47:05 UTC
Missing unit test results from devel.

Comment 8 Lon Hohberger 2011-06-29 13:59:19 UTC
Created attachment 510473 [details]
Test

Comment 11 errata-xmlrpc 2011-12-06 12:02:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1580.html


Note You need to log in before you can comment on or make changes to this bug.