Bug 70708

Summary: nfs initscript has wrong error handling
Product: [Retired] Red Hat Linux Reporter: Peter van Egdom <p.van.egdom>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: 8.0CC: iusty
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-15 21:43:20 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:

Description Peter van Egdom 2002-08-04 13:54:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1b) Gecko/20020721

Description of problem:
When I'm a non-root user and do the following :

[peterve@limbo-pc init.d]$ ./nfs stop
Stopping NFS mountd:                                       [FAILED]
Stopping NFS daemon:                                       [FAILED]
Stopping NFS services:                                     [  OK  ]
Stopping NFS quotas:                                       [FAILED]

(and again)

[peterve@limbo-pc init.d]$ ./nfs stop
Stopping NFS mountd:                                       [FAILED]
Stopping NFS daemon:                                       [FAILED]
Stopping NFS services:                                     [  OK  ]
Stopping NFS quotas:                                       [FAILED]

it says [  OK  ] at stopping NFS services.

It should not say that, let alone saying that _twice_ ! :-)


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. as a normal user : "./nfs stop" in "/etc/rc.d/init.d"
2.
3.
	

Actual Results:
Stopping NFS mountd:                                       [FAILED]
Stopping NFS daemon:                                       [FAILED]
Stopping NFS services:                                     [  OK  ]
Stopping NFS quotas:                                       [FAILED]


Expected Results:
Stopping NFS mountd:                                       [FAILED]
Stopping NFS daemon:                                       [FAILED]
Stopping NFS services:                                     [FAILED]
Stopping NFS quotas:                                       [FAILED]



Additional info:

Source RPM: nfs-utils-1.0.1-1.src.rpm

Comment 1 Iustin Pop 2002-12-07 23:02:30 UTC
Moreover, when RQUOTAD=no in /etc/sysconfig/nfs, the start() function does not
start the rpc.rquotad daemon, but the stop function tries to stop it anyway, and
fails, so it gives an error. Also the status function ignores the case when
RQUOTAD=no. The /etc/rc.d/init.d/nfs scripts should be changed:
--- nfs.orig    2002-12-08 01:03:06.000000000 +0200
+++ nfs 2002-12-08 01:03:34.000000000 +0200
@@ -126,7 +126,7 @@
        echo -n $"Shutting down NFS daemon: "
        killproc nfsd
        echo
-       if [ -n "$RQUOTAD" ]; then
+       if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
                echo -n "Shutting down NFS quotas: "
                killproc rpc.rquotad
                echo
@@ -139,7 +139,7 @@
   status)
        status rpc.mountd
        status nfsd
-       if [ -n "$RQUOTAD" ]; then
+       if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
                status rpc.rquotad
        fi
        ;;


Comment 2 Steve Dickson 2004-06-15 21:43:20 UTC
although "Stopping NFS services:" is truly bad way to saying
"Removing exports", the fact of the matter it is succeeding...

w.r.t. comment 2, this patch is in the current release