Module Name:    src
Committed By:   cegger
Date:           Tue Sep  8 08:56:34 UTC 2009

Modified Files:
        src/etc/rc.d: network

Log Message:
Do not flush routes if root file system is nfs mounted.
Fixes boot problem when the nfs server is in a different subnet.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/etc/rc.d/network

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/network
diff -u src/etc/rc.d/network:1.58 src/etc/rc.d/network:1.59
--- src/etc/rc.d/network:1.58	Thu May 14 15:33:36 2009
+++ src/etc/rc.d/network	Tue Sep  8 08:56:33 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: network,v 1.58 2009/05/14 15:33:36 roy Exp $
+# $NetBSD: network,v 1.59 2009/09/08 08:56:33 cegger Exp $
 #
 
 # PROVIDE: network
@@ -12,6 +12,7 @@
 name="network"
 start_cmd="network_start"
 stop_cmd="network_stop"
+fstab_file="/etc/fstab"
 
 nl='
 ' # a newline
@@ -54,6 +55,26 @@
 		domainname $domainname
 	fi
 
+	# Do not flush routes if root file system is nfs mounted in /etc/fstab,
+	# or the nfs server is unreachable if it is in a different subnet,
+	# otherwise.
+	while read fs_spec fs_file fs_vfstype fs_mntops fs_freq fs_passno
+	do
+		case "${fs_spec}:${fs_file}:${fs_passno}" in
+		\#*|'':*)
+			continue # skip comment or blank line
+			;;
+		*:/:*)  case "${fs_spec}" in
+			*:*)
+				echo "Not flushing routes. /: nfs mounted"
+				flushroutes="NO"
+				;;
+			esac
+			;;
+		esac
+	done <"${fstab_file}"
+
+
 	# Flush all routes just to make sure it is clean
 	if checkyesno flushroutes; then
 		/sbin/route -qn flush

Reply via email to