Bug 485905 - nfs rc script return codes not LSB compliant
nfs rc script return codes not LSB compliant
Status: CLOSED DUPLICATE of bug 710020
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils (Show other bugs)
5.2
All Linux
low Severity low
: rc
: ---
Assigned To: Steve Dickson
yanfu,wang
private-RHEL5-7
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-17 06:57 EST by Frank Sweetser
Modified: 2011-09-30 17:12 EDT (History)
1 user (show)

See Also:
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 17:12:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed fix for status option (795 bytes, application/octet-stream)
2009-02-17 06:58 EST, Frank Sweetser
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
CentOS 3393 None None None Never

  None (edit)
Description Frank Sweetser 2009-02-17 06:57:19 EST
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 06:58:31 EST
Created attachment 332210 [details]
Proposed fix for status option
Comment 2 Frank Sweetser 2009-02-17 07:27:30 EST
Forgot to include the package version:

[fs@ipfm ~]$ rpm -q nfs-utils
nfs-utils-1.0.9-35z.el5_2
Comment 4 RHEL Product and Program Management 2011-01-11 14:54:55 EST
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 Product and Program Management 2011-01-11 18:10:23 EST
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 04:59:32 EDT
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 06:03:03 EDT
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 07:12:04 EDT

*** This bug has been marked as a duplicate of bug 534133 ***
Comment 10 yanfu,wang 2011-06-14 22:45:37 EDT
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 Product and Program Management 2011-06-21 01:57:36 EDT
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 17:12:13 EDT

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

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