Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 534133

Summary: nfs and nfslock init script returns incorrect error code when not running
Product: Red Hat Enterprise Linux 5 Reporter: Colin Petrie <l4gr5le02>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: yanfu,wang <yanwang>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.4CC: cevich, cww, fs, harshula, jlayton, mpoole, redhat-bugzilla, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.0.9-53 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 11:34:55 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:
Bug Depends On:    
Bug Blocks: 590060    

Description Colin Petrie 2009-11-10 17:05:15 UTC
Description of problem:
If nfs or nfslock is not running, then calling 'service nfslock status' or 'service nfs status' returns exit code 0, when it should normally return 3.

Version-Release number of selected component (if applicable):
nfs-utils-1.0.9-42

How reproducible:
Consistently

Steps to Reproduce:
1.Install nfs-utils package
2.Ensure all services are stopped (do 'service nfslock stop', 'service nfs stop')
3.Query status of services
  
Actual results:
[root@test ~]# service nfs status; echo $?
rpc.mountd is stopped
nfsd is stopped
0

[root@test ~]# service nfslock status; echo $?
rpc.statd is stopped
0


Expected results:
According to LSB
(http://refspecs.freestandards.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html)

If the status action is requested, the init script will return the following
exit status codes.
0 program is running or service is OK
<snip>
3 program is not running
<snip>

Comment 7 yanfu,wang 2011-06-01 10:25:42 UTC
verified on x86_64 and i386, nfs init script return correct error code when not running, but nfslock init script still return wrong error code:
# rpm -qa|grep nfs-utils
nfs-utils-lib-1.0.8-7.6.el5
nfs-utils-1.0.9-52.el5

# service nfs status; echo $?
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
3

# /etc/init.d/nfslock status ; echo $?
rpc.statd is stopped
0

Comment 10 yanfu,wang 2011-06-07 02:50:20 UTC
the bug have fixed again and the errata state change from NEW_FILES to QE also, pls refer to:
https://errata.devel.redhat.com/errata/show/11120#c19
But the bug still in MODIFIED, so I change it to ON_QA by manual.

Comment 11 yanfu,wang 2011-06-07 03:07:00 UTC
verified on nfs-utils-1.0.9-53.el5 i386 and x86_64 package, test passed:
[root@hp-dl360g4-01 ~]# /etc/init.d/rpcsvcgssd status;echo $?
rpc.svcgssd is stopped
3
[root@hp-dl360g4-01 ~]# /etc/init.d/rpcgssd status;echo $?
rpc.gssd is stopped
3
[root@hp-dl360g4-01 ~]# /etc/init.d/rpcidmapd status;echo $?
rpc.idmapd is stopped
3
[root@hp-dl360g4-01 ~]# /etc/init.d/nfs status;echo $?
rpc.svcgssd is stopped
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
3
[root@hp-dl360g4-01 ~]# /etc/init.d/nfslock status;echo $?
rpc.statd is stopped
3

Comment 12 Steve Dickson 2011-06-14 11:12:04 UTC
*** Bug 485905 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2011-07-21 11:34:55 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1048.html