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.
Created attachment 332210 [details] Proposed fix for status option
Forgot to include the package version: [fs@ipfm ~]$ rpm -q nfs-utils nfs-utils-1.0.9-35z.el5_2
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.
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.
The bug same with https://bugzilla.redhat.com/show_bug.cgi?id=534133 which is back to developer now.
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.
*** This bug has been marked as a duplicate of bug 534133 ***
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.
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.
*** This bug has been marked as a duplicate of bug 710020 ***