Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1205055

Summary: start nfs with RPCNFSDARGS="--invalid-args" in /etc/sysconfig/nfs should return errno 1 but return 0
Product: Red Hat Enterprise Linux 6 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact: Milan Navratil <mnavrati>
Priority: unspecified    
Version: 6.6CC: coughlan, dwysocha, eguan, jiyin, mkolaja, rkothiya, steved
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-1.2.3-71.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 11:22:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yongcheng Yang 2015-03-24 07:28:35 UTC
Description of problem:
Add some invalid arguments in /etc/sysconfig/nfs, such as RPCNFSDARGS="--invalid-args", and then start nfs service, it echo error messages as expected, but NOT return errno 1 as rhel7 does

Version-Release number of selected component (if applicable):
RHEL-6.7 with nfs-utils-1.2.3-59.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. echo "RPCNFSDARGS=\"--invalid-args\"" > /etc/sysconfig/nfs
2. service nfs restart
3. echo $?

Actual results:
[root@hp-dl385pg8-10 ~]# cat /etc/sysconfig/nfs
RPCNFSDARGS="--invalid-args"
[root@hp-dl385pg8-10 ~]# service_nfs restart
Shutting down NFS daemon: [  OK  ]
Shutting down NFS mountd: [  OK  ]
Shutting down NFS quotas: [  OK  ]
Shutting down NFS services:  [  OK  ]
Shutting down RPC idmapd: [  OK  ]
Starting NFS services:  [  OK  ]
Starting NFS quotas: [  OK  ]
Starting NFS mountd: [  OK  ]
Starting NFS daemon: rpc.nfsd: unrecognized option '--invalid-args'
Invalid argument: '?'
Usage:
rpc.nfsd [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] nrservs
[FAILED]
[root@hp-dl385pg8-10 ~]# echo $?
0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Should return errno 1
[root@hp-dl385pg8-10 ~]# service nfs status
rpc.svcgssd is stopped
rpc.mountd (pid 10910) is running...
nfsd dead but subsys locked
rpc.rquotad (pid 10905) is running...
[root@hp-dl385pg8-10 ~]# showmount -e
Export list for hp-dl385pg8-10.rhts.eng.pek2.redhat.com:
/export *
[root@hp-dl385pg8-10 ~]# 
[root@hp-dl385pg8-10 ~]# mount localhost:/export /mnt/mnt_test/
mount.nfs: Connection timed out
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The mount hang and will fail
[root@hp-dl385pg8-10 ~]# rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100011    1   udp    875  rquotad
    100011    2   udp    875  rquotad
    100011    1   tcp    875  rquotad
    100011    2   tcp    875  rquotad
    100005    1   udp  35346  mountd
    100005    1   tcp  33432  mountd
    100005    2   udp  38664  mountd
    100005    2   tcp  49201  mountd
    100005    3   udp  48248  mountd
    100005    3   tcp  45799  mountd
[root@hp-dl385pg8-10 ~]# 
[root@hp-dl385pg8-10 ~]# rpcinfo -s 
   program version(s) netid(s)                         service     owner
    100000  2,3,4     local,udp,tcp,udp6,tcp6          portmapper  superuser
    100011  2,1       tcp,udp                          rquotad     superuser
    100005  3,2,1     tcp6,udp6,tcp,udp                mountd      superuser
[root@hp-dl385pg8-10 ~]# 


Expected results:
"service nfs restart" return 1

Additional info:
It acts as expect in rhel-7.1

Comment 2 Steve Dickson 2015-10-21 15:57:15 UTC
(In reply to Yongcheng Yang from comment #0)
> Expected results:
> "service nfs restart" return 1
> 
> Additional info:
> It acts as expect in rhel-7.1
I think this expectation is wrong because 
7.1 uses systemd and rhel6 does not.

looking at the code the rpc.nfsd is actually exiting 
with a value of two:

static void
usage(const char *prog)
{
    fprintf(stderr, "Usage:\n"
        "%s [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] nrservs\n",
        prog);
    exit(2);
}

and in the start up script the return value is be recorded:
    echo -n $"Starting NFS daemon: "
    daemon rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT
    RETVAL=$?
    echo
    [ $RETVAL -ne 0 ] && exit $RETVAL

So it appears the problem is in the daemon script?

Comment 7 Yongcheng Yang 2016-10-31 03:03:01 UTC
Moving to VERIFIED according to the test logs of Comment #6.

Will include this automatic case as regression tests in the future.

Comment 14 errata-xmlrpc 2017-03-21 11:22:50 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.

https://rhn.redhat.com/errata/RHBA-2017-0741.html