RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 663045 - nfs won't stop on reboot or halt
Summary: nfs won't stop on reboot or halt
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: nfs-utils
Version: 6.1
Hardware: i686
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: yanfu,wang
URL:
Whiteboard:
Depends On: 652786
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-14 14:51 UTC by Steve Dickson
Modified: 2012-08-21 18:01 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 652786
Environment:
Last Closed: 2011-03-10 13:23:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Steve Dickson 2010-12-14 14:51:02 UTC
+++ This bug was initially created as a clone of Bug #652786 +++

Description of problem:

When rebooting or halting a system with the NFS service running, the NFS service won't stop.

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

nfs-utils-1.2.3-1.fc14.i686

How reproducible:

Operate system normally with NFS services running. 

Steps to Reproduce:
1. Have NFS start either on runlevel or manual start
2. Reboot or halt system

  
Actual results:

NFS fails to stop. This leads to error messages that /var is in use.

Expected results:

NFS service stops. Clean reboot or halt without error messages.

Additional info:

If NFS is stopped manually before reboot/halt like so:

# service nfs stop

it will stop cleanly and show appropriate messages for various components. However, when the system is rebooting or halting no NFS messages are seen, seeming to indicate that it never shuts down.

--- Additional comment from steved on 2010-11-23 14:54:08 EST ---

what does is the output of 'ps ax | grep nfsd' after the service is stopped?

--- Additional comment from gwirth79 on 2010-11-23 15:29:02 EST ---

(In reply to comment #1)
> what does is the output of 'ps ax | grep nfsd' after the service is stopped?

Here is the result of stopping the nfs service:

[gus@falcon ~]$ sudo service nfs stop
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
[gus@falcon ~]$ ps ax|grep nfs
28923 pts/7    S+     0:00 grep --color=auto nfs
[gus@falcon ~]$

As you can see, if the nfs service is stopped from the command line before the system is shut down, it stops cleanly. When the system is shut down with nfs running, I never see the "Shutting down ..." messages. It's as if the init script never gets called.

I did all my testing from run level 3 to eliminate GUI problems, and I don't have any clients connected. Because the system is shutting down, I'm not sure how to capture the console messages. I could try to set up a serial console and capture the shutdown sequence.

I also turned off almost all other services. I'll see what the bare minimum is to trigger the problem.

--- Additional comment from gwirth79 on 2010-11-24 16:45:14 EST ---

I found the bug. It exists because the subsystem lock file name does not match the init script name. The /etc/rc.d/rc script checks to see if a subsytem is running by using the name of the init script for the subsystem file. In the case of the NFS subsystem, the NFS init script creates a subsysetm file /var/lock/subsys/nfsd. It should be nfs (no d on the end).

I noticed that this subsystem check affects several other systems also, for example CUPS and rsyslog. I wrote a tiny little program to check the subsystem status (derived from /etc/rc.d/rc):

#!/bin/bash
# check if a subsystem is running based on what needs to be killed
runlevel=6

# First, run the KILL scripts.
for i in /etc/rc$runlevel.d/K* ; do

	# Check if the subsystem is already up.
	subsys=${i#/etc/rc$runlevel.d/K??}
	echo "Checking for $subsys"
	[ -f /var/lock/subsys/$subsys ] || [ -f /var/lock/subsys/$subsys.init ] || echo "$subsys does not exist"

done



Patch for /etc/init.d/nfs:

--- nfs.orig    2010-11-24 10:24:15.191119091 -0800
+++ nfs 2010-11-24 13:26:52.369559897 -0800
@@ -124,7 +124,7 @@
        RETVAL=$?
        echo
        touch /var/lock/subsys/rpc.mountd
-       touch /var/lock/subsys/nfsd
+       touch /var/lock/subsys/nfs
 
        # Let rpc.idmapd know that rpc.mountd just started
        [ -x /usr/sbin/rpc.idmapd ] && /sbin/service rpcidmapd condstart

--- Additional comment from gwirth79 on 2010-11-24 18:25:07 EST ---

Created attachment 462775 [details]
patch to fix nfs shutdown problem

--- Additional comment from gwirth79 on 2010-11-24 18:27:32 EST ---

I missed a few places. The attached patch gets all the remaining nfs vs nfsd substitutions.

--- Additional comment from steved on 2010-12-01 12:07:35 EST ---

*** Bug 655726 has been marked as a duplicate of this bug. ***

--- Additional comment from updates on 2010-12-02 08:56:00 EST ---

nfs-utils-1.2.3-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/nfs-utils-1.2.3-2.fc14

--- Additional comment from updates on 2010-12-02 14:17:19 EST ---

nfs-utils-1.2.3-2.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nfs-utils'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/nfs-utils-1.2.3-2.fc14

--- Additional comment from gwirth79 on 2010-12-02 17:06:21 EST ---

There is a similar problem in rpc.idmapd which is also part of nfs-utils. Simple patch attached to fix.

--- Additional comment from gwirth79 on 2010-12-02 17:08:09 EST ---

Created attachment 464390 [details]
patch to fix rpcidmapd shutdown problem

--- Additional comment from updates on 2010-12-10 15:31:15 EST ---

nfs-utils-1.2.3-2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 1 Ray Van Dolson 2011-03-09 01:11:29 UTC
Steve, any chance of this making it into RHEL 6.0 errata or is 6.1 the target?

Comment 4 Steve Huston 2012-08-21 18:01:00 UTC
Running RHEL 6.3, this has resurfaced; I just traced through things to find the problem is the same and a coworker directed me to this bug.  nfs-utils-1.2.3-26.el6.src.rpm is the version installed.


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