Bug 14846

Summary: "netfs stop" wants to unmount / even when it's on NFS.
Product: [Retired] Red Hat Linux Reporter: Aleksey Nogin <aleksey>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.2CC: jyh, rvokal
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: 2000-07-31 19:28:02 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:
Attachments:
Description Flags
The patch to fix it. none

Description Aleksey Nogin 2000-07-30 00:58:17 UTC
When root-over-NFS setup is used, netfs insists on unmounting / on
shutdown. The following patch fixes it.

P.S. It's bad programming style to have it in 3 places instead of a single
one.

--- /etc/rc.d/init.d/netfs      Mon Sep 20 10:45:22 1999
+++ /tftpboot/root/etc/rc.d/init.d/netfs        Sat Jul 29 17:52:38 2000
@@ -25,7 +25,7 @@
 NFSFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^nfs$/ && $4 !~
/noauto/) print $2}'`
 SMBFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^smbfs$/ && $4 !~
/noauto/) print $2}'`
 NCPFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^ncpfs$/ && $4 !~
/noauto/) print $2}'`
-NFSMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^nfs$/ ) print $2}'`
+NFSMTAB=`grep -v '^#' /proc/mounts | awk '{ if (($3 ~ /nfs$/) && ($2 !=
"/")) print $2}'`
 SMBMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^smbfs$/ ) print
$2}'`
 NCPMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^ncpfs$/ ) print
$2}'`
 
@@ -42,7 +42,7 @@
        [ -n "$NFSMTAB" ] && {
                sig=
                retry=3
-               remaining=`awk '!/^#/ && $3 ~ /^nfs/ {print $2}'
/proc/mounts`
+               remaining=`awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/" {print
$2}' /proc/mounts`
                while [ -n "$remaining" -a "$retry" -gt 0 ]
                do
                        if [ "$retry" -lt 3 ]; then
@@ -51,7 +51,7 @@
                                action "Unmounting NFS filesystems" umount
-f -a -t nfs
                        fi
                        sleep 2
-                       remaining=`awk '!/^#/ && $3 ~ /^nfs/ {print $2}'
/proc/mounts`
+                       remaining=`awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/"
{print $2}' /proc/mounts`
                        [ -z "$remaining" ] && break
                        /sbin/fuser -k -m $sig $remaining >/dev/null
                        sleep 5

Comment 1 Aleksey Nogin 2000-07-31 19:28:01 UTC
Created attachment 1714 [details]
The patch to fix it.

Comment 2 Bill Nottingham 2000-07-31 19:43:00 UTC
Thanks for the patch; this will be fixed in initscripts-5.40-1.