aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>2001-12-27 13:41:27 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>2001-12-27 13:41:27 +0000
commitd7fb353a4328df9c8f3d2b4735313e36f794538e (patch)
tree69e6a4dfd4e1e8c2aab2a8a47eeb1b5f7763d5cb /etc
parentca33a43ede6dbaf0049a29341bceeb0f13496eff (diff)
downloadsrc-d7fb353a4328df9c8f3d2b4735313e36f794538e.tar.gz
src-d7fb353a4328df9c8f3d2b4735313e36f794538e.zip
Re-introduce the fix that delays mounting of network filesystems until
the network is initialized. This was first implemented in rev 1.268 of src/etc/rc, but was backed out at wollman's request. The objection was that the right place for the fix is in mount(8). Having looked at that problem, I find it hard to believe that the hoops one would have to jump through can be justified by the desire for purity alone. Note that there are reported issues surrounding nfsclient kernel support and mount_nfs(8), which currently make NFS an ugly exception to the general case. With this change, systems with non-NFS network filesystems configured for mounting on startup in /etc/fstab are no longer guaranteed to fail on startup.
Notes
Notes: svn path=/head/; revision=88531
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/rc.conf2
-rw-r--r--etc/rc33
2 files changed, 34 insertions, 1 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index aeeaea824ace..1f759af7b210 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -36,6 +36,8 @@ script_name_sep=" " # Change if your startup scripts' names contain spaces
rc_conf_files="/etc/rc.conf /etc/rc.conf.local"
fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails.
background_fsck="YES" # Attempt to run fsck in the background where possible.
+networkfs_types="nfs:NFS smbfs:SMB portalfs:PORTAL" # List of network
+ # filesystem types for delayed mount at startup.
##############################################################
### Network configuration sub-section ######################
diff --git a/etc/rc b/etc/rc
index e73856902dfd..fc784b92eee9 100644
--- a/etc/rc
+++ b/etc/rc
@@ -268,7 +268,16 @@ esac
umount -a >/dev/null 2>&1
# Mount everything except nfs filesystems.
-mount -a -t nonfs
+if [ -z "${networkfs_types}" ]; then
+ networkfs_types='nfs:NFS smbfs:SMB portalfs:PORTAL'
+fi
+mount_excludes='no'
+for i in ${networkfs_types}; do
+ fstype=${i%:*}
+ mount_excludes="${mount_excludes}${fstype},"
+done
+mount_excludes=${mount_excludes%,}
+mount -a -t ${mount_excludes}
case $? in
0)
@@ -407,6 +416,11 @@ case ${ipv6_enable} in
esac
# Mount NFS filesystems if present in /etc/fstab
+#
+# XXX When the vfsload() issues with nfsclient support and related sysctls
+# have been resolved, this block can be removed, and the condition that
+# skips nfs in the following block (for "other network filesystems") can
+# be removed.
case "`mount -d -a -t nfs 2> /dev/null`" in
*mount_nfs*)
# Handle absent nfs client support
@@ -430,6 +444,23 @@ case "`mount -d -a -t nfs 2> /dev/null`" in
;;
esac
+# Mount other network filesystems if present in /etc/fstab
+for i in ${networkfs_types}; do
+ fstype=${i%:*}
+ fsdecr=${i#*:}
+
+ if [ "${fstype}" = "nfs" ]; then
+ continue
+ fi
+ case "`mount -d -a -t ${fstype}`" in
+ *mount_${fstype}*)
+ echo -n "Mounting ${fsdecr} file systems:"
+ mount -a -t ${fstype}
+ echo '.'
+ ;;
+ esac
+done
+
# Whack the pty perms back into shape.
#
if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then