Bug 485905

Summary: nfs rc script return codes not LSB compliant
Product: Red Hat Enterprise Linux 5 Reporter: Frank Sweetser <fs>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED DUPLICATE QA Contact: yanfu,wang <yanwang>
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: ralph
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: private-RHEL5-7
Fixed In Version: nfs-utils-1.0.9-51.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-30 21:12:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed fix for status option none

Description Frank Sweetser 2009-02-17 11:57:19 UTC
The nfs rc script return codes are not compatible with the LSB init script actions spec as per http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html  Most importantly, the status option always returns zero, whether the service is running, stopped, or crashed.  This makes the nfs service unmanageable via anything that checks the return code, such as puppet.

While I'm not sure if it's the best way, given that the status is actually an aggregate of several status commands, I've attached a patch that at least comes closer to giving accurate return codes.

Comment 1 Frank Sweetser 2009-02-17 11:58:31 UTC
Created attachment 332210 [details]
Proposed fix for status option

Comment 2 Frank Sweetser 2009-02-17 12:27:30 UTC
Forgot to include the package version:

[fs@ipfm ~]$ rpm -q nfs-utils
nfs-utils-1.0.9-35z.el5_2

Comment 4 RHEL Program Management 2011-01-11 19:54:55 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 5 RHEL Program Management 2011-01-11 23:10:23 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 7 yanfu,wang 2011-06-02 08:59:32 UTC
The bug same with https://bugzilla.redhat.com/show_bug.cgi?id=534133 which is back to developer now.

Comment 8 yanfu,wang 2011-06-10 10:03:03 UTC
I've filed a new bug 710020 for RHEL5 nfs-utils initscripts improvement, and since the bug filed for nfs rc script return codes, so I will just track nfs initscript for the bug.
I tested start, restart, stop following status action, the return codes are  compatible with the LSB init script spec. But if nfs is dead and /var/lock lock file exists, the expected exit status code should be "2", but it return "3" instead (the problem also described in bug 710020 of comment #0 - issue 4).

reproducer:
# /etc/init.d/nfs stop
Shutting down NFS mountd: [  OK  ]
Shutting down NFS daemon: [  OK  ]
Shutting down NFS quotas: [  OK  ]
Shutting down NFS services:  [  OK  ]
# touch /var/lock/subsys/nfs
# /etc/init.d/nfs status;echo $?
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
3

So the nfs rc script return code still have problem and I will assign it back to you.
Steve, could you resolve it ASAP and could you check bug 710020 to review if it will be included in the current release? thanks.

Comment 9 Steve Dickson 2011-06-14 11:12:04 UTC

*** This bug has been marked as a duplicate of bug 534133 ***

Comment 10 yanfu,wang 2011-06-15 02:45:37 UTC
hi Steve,
Since the bug 534133 focus testing nfs and nfslock init script returns incorrect error code when the service isn't running, so I didn't cover others condition there, and I test more init script compatible with the LSB here such as program is dead and /var/lock lock file exists return status code and found there's still problem exist.
Like as comment #8 stated: if nfs is dead and /var/lock lock file exists, the expected exit status code should be "2", but it return "3":
# touch /var/lock/subsys/nfs
# /etc/init.d/nfs status;echo $?
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
3

In fact, others init script also have problems:
# touch /var/lock/subsys/nfslock
# /etc/init.d/nfslock status;echo $?
rpc.statd is stopped
0
# touch /var/lock/subsys/rpcidmapd
# /etc/init.d/rpcidmapd status;echo $?
rpc.idmapd is stopped
3

Since the bug is focus on nfs rc script return codes mainly, maybe you just need to fix the nfs init script issue in the current release, and there are more nfs-utils init scripts problem that I've filed in bug 710020.

Comment 11 RHEL Program Management 2011-06-21 05:57:36 UTC
This request was evaluated by Red Hat Product Management for inclusion in Red Hat Enterprise Linux 5.7 and Red Hat does not plan to fix this issue the currently developed update.

Contact your manager or support representative in case you need to escalate this bug.

Comment 13 Steve Dickson 2011-09-30 21:12:13 UTC

*** This bug has been marked as a duplicate of bug 710020 ***