Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 691814 - nfsclient exports doens't work.
nfsclient exports doens't work.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Lon Hohberger
Cluster QE
:
Depends On: 592624
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-29 10:27 EDT by Lon Hohberger
Modified: 2011-12-06 07:02 EST (History)
8 users (show)

See Also:
Fixed In Version: resource-agents-3.9.1-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 592624
Environment:
Last Closed: 2011-12-06 07:02:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1580 normal SHIPPED_LIVE Low: resource-agents security, bug fix, and enhancement update 2011-12-05 19:38:57 EST

  None (edit)
Description Lon Hohberger 2011-03-29 10:27:39 EDT
+++ 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@redhat.com on 2011-03-28 16:44:48 EDT ---

Created attachment 488253 [details]
Fixes problem #1.

--- Additional comment from lhh@redhat.com 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 09:47:05 EDT
Missing unit test results from devel.
Comment 8 Lon Hohberger 2011-06-29 09:59:19 EDT
Created attachment 510473 [details]
Test
Comment 11 errata-xmlrpc 2011-12-06 07:02:45 EST
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.