Bug 14846 - "netfs stop" wants to unmount / even when it's on NFS.
"netfs stop" wants to unmount / even when it's on NFS.
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-29 20:58 EDT by Aleksey Nogin
Modified: 2014-03-16 22:15 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-07-31 15:28:02 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)
The patch to fix it. (1.69 KB, patch)
2000-07-31 15:28 EDT, Aleksey Nogin
no flags Details | Diff

  None (edit)
Description Aleksey Nogin 2000-07-29 20:58:17 EDT
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 15:28:01 EDT
Created attachment 1714 [details]
The patch to fix it.
Comment 2 Bill Nottingham 2000-07-31 15:43:00 EDT
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.