summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcegger <cegger@NetBSD.org>2009-09-08 08:56:33 +0000
committercegger <cegger@NetBSD.org>2009-09-08 08:56:33 +0000
commiteb4ebcd11a592bd6dd53208237bc67c6f52cf2cb (patch)
treec56f80f335b9f73eec278e0644490f8bb6f1c539
parent5946cee966eda6a0c4f20392906524853fd41698 (diff)
Do not flush routes if root file system is nfs mounted.
Fixes boot problem when the nfs server is in a different subnet.
-rwxr-xr-xetc/rc.d/network23
1 files changed, 22 insertions, 1 deletions
diff --git a/etc/rc.d/network b/etc/rc.d/network
index 0270c40e111..5cf45c134e9 100755
--- a/etc/rc.d/network
+++ b/etc/rc.d/network
@@ -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 @@ $_rc_subr_loaded . /etc/rc.subr
name="network"
start_cmd="network_start"
stop_cmd="network_stop"
+fstab_file="/etc/fstab"
nl='
' # a newline
@@ -54,6 +55,26 @@ network_start()
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