Bug 218231 - NFSd shutdown is very slow due to script bug
NFSd shutdown is very slow due to script bug
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: nfs-utils (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Steve Dickson
:
Depends On:
Blocks: 222001
  Show dependency treegraph
 
Reported: 2006-12-03 17:53 EST by Tamas Kerecsen
Modified: 2007-11-16 20:14 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2007-0316
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-01 19:27:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tamas Kerecsen 2006-12-03 17:53:32 EST
Description of problem:
The /etc/init.d/nfs script tries to shut down nfsd using "killproc nfsd".
Killproc first sends a TERM signal to all nfsd instances, then waits for 4
seconds and finally sends a KILL signal. Since nfsd ignores the TERM signal, the
script will always have to wait 4 seconds, slowing down the shutdown by 4
seconds each time.

(I'm not sure about the rationale behind ignoring TERM, but based on some
comments in the equivalent code in freeBSD, it seems that the designers wanted
to make sure nfsd is the last daemon to get killed so the loopback mounts can be
unmounted properly.) 

As the comments in the kernel's fs/nfsd/nfssvc.c explain, the virtual nfsd
kernel processes should be killed by sending a KILL, HUP, INT or QUIT signal to
them (with HUP being the fastest as it will forgo cleaning the exports table).

An even more future-proof and robust solution is calling "rpc.nfsd -- 0", which
sets the number of nfsd processes to 0 thus killing all current instances.
(Internally it is equivalent to sending a HUP to all processes, but much faster
and more robust because it's only a single kernel call.)

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

How reproducible:

Steps to Reproduce:
1. Execute "/etc/init.d/nfs stop"
2.
3.
  
Actual results:
It takes just over 4 seconds for the script to complete

Expected results:
It should take less than 1 second for the script to complete

Additional info:
N/A
Comment 1 RHEL Product and Program Management 2006-12-08 08:33:14 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 3 Steve Dickson 2007-01-09 10:29:51 EST
Fixed in nfs-utils-1.0.6-76
Comment 7 Red Hat Bugzilla 2007-05-01 19:27:57 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 the 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-2007-0316.html

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