Bug 703203 - System halt does not unmount mount points with nfs in the path name.
System halt does not unmount mount points with nfs in the path name.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts (Show other bugs)
5.6
Unspecified Linux
unspecified Severity low
: rc
: ---
Assigned To: initscripts Maintenance Team
qe-baseos-daemons
:
Depends On:
Blocks: 703210
  Show dependency treegraph
 
Reported: 2011-05-09 12:15 EDT by Jeremy Mueller
Modified: 2011-07-21 08:41 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Due to a bug in the /etc/init.d/halt script, no mount point set up with the word "nfs" anywhere in its path could be unmounted at reboot or shutdown. This bug has been fixed and such mount points are now unmounted properly.
Story Points: ---
Clone Of:
: 703210 (view as bug list)
Environment:
Last Closed: 2011-07-21 04:34:07 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)
Unified diff to fix the umount error in /etc/init.d/halt. (586 bytes, application/octet-stream)
2011-05-09 12:15 EDT, Jeremy Mueller
no flags Details

  None (edit)
Description Jeremy Mueller 2011-05-09 12:15:15 EDT
Created attachment 497858 [details]
Unified diff to fix the umount error in /etc/init.d/halt.

Description of problem:

If you have a mount point setup with the word "nfs" anywhere in the path, the mount will not be unmounted at reboot/halt time.

This also affects the keywords loopfs, autofs, cifs, smbfs, ncpfs, sysfs.


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

initscripts-8.45.33-1.el5


How reproducible:

Always

Steps to Reproduce:
1. Create a mount point called /shares and mount a device there.
2. Create another mount point called /shares/nfsfiles and mount a device there (in our case we use LVM volumes for both mount points).
3. sudo reboot
  
Actual results:

During the halt process you will receive "umount: /shares: device is busy" errors because /shares/nfsfiles was not unmounted.

Expected results:

The system unmounts /shares/nfsfiles then unmounts /shares.

Additional info:

This problem is caused by the awk statements in /etc/init.d/halt.  Specifically:

/(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next}

That will match the keywords anywhere in a line in /proc/mounts, so will match NFS mounts (nfs in 3rd column) and nfs in paths (/shares/nfsfiles in 2nd column).

The fix to this would be to change that awk statement to:

$3 ~ /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs)/ {next}
/(^none|^\/dev\/ram|^\/dev\/root$)/ {next}

I've attached a unified diff file with the fix.
Comment 1 Bill Nottingham 2011-05-09 12:37:42 EDT
Thanks, added to git master as commit a8295af.

Note that this would require them not getting unmounted in netfs stop, unless I'm missing something?
Comment 2 RHEL Product and Program Management 2011-05-09 12:49:33 EDT
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 Jeremy Mueller 2011-05-09 14:01:47 EDT
(In reply to comment #1)
> Thanks, added to git master as commit a8295af.
> 
> Note that this would require them not getting unmounted in netfs stop, unless
> I'm missing something?

It's not that the mount is an NFS mount, it's that the name of the path for the mount point contains the keyword "nfs".  In our case, the mount point is an LVM with XFS on it.  It's then exported to other servers.  We could have easily called it something like "/shares/export" instead of "/shares/nfsfiles".  Here's our relevant entry in /proc/mounts:

/dev/mapper/vg0-lvolstoreb /shares/nfsfiles xfs rw,nobarrier,logbufs=8,sunit=128,swidth=256,noquota 0 0

Thanks for committing it.
Comment 9 Tomas Capek 2011-07-13 08:28:08 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Due to a bug in the /etc/init.d/halt script, no mount point set up with the word "nfs" anywhere in its  path could be unmounted at reboot or shutdown. This bug has been fixed and such mount points are now unmounted properly.
Comment 10 errata-xmlrpc 2011-07-21 04:34:07 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-1081.html
Comment 11 errata-xmlrpc 2011-07-21 08:41:11 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-1081.html

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