Bug 534133 - nfs and nfslock init script returns incorrect error code when not running
nfs and nfslock init script returns incorrect error code when not running
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils (Show other bugs)
5.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Steve Dickson
yanfu,wang
:
Depends On:
Blocks: 590060
  Show dependency treegraph
 
Reported: 2009-11-10 12:05 EST by Colin Petrie
Modified: 2011-07-21 07:34 EDT (History)
8 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Colin Petrie 2009-11-10 12:05:15 EST
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 06:25:42 EDT
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-06 22:50:20 EDT
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-06 23:07:00 EDT
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 07:12:04 EDT
*** Bug 485905 has been marked as a duplicate of this bug. ***
Comment 13 errata-xmlrpc 2011-07-21 07:34:55 EDT
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

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