Bug 14846 - "netfs stop" wants to unmount / even when it's on NFS.
Summary: "netfs stop" wants to unmount / even when it's on NFS.
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 6.2
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-07-30 00:58 UTC by Aleksey Nogin
Modified: 2014-03-17 02:15 UTC (History)
2 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2000-07-31 19:28:02 UTC


Attachments (Terms of Use)
The patch to fix it. (1.69 KB, patch)
2000-07-31 19:28 UTC, Aleksey Nogin
no flags Details | Diff

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.


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