summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/mountcritlocal
diff options
context:
space:
mode:
authorgordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
committergordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
commit9c5433cb225f7a4e56e87623ea2e4011179553a5 (patch)
tree3168589e209abd888b033397e3c46dee6131a116 /etc/rc.d/mountcritlocal
parent50d99cdfecd92f5323a18aa791a5b1cb9d8b7191 (diff)
downloadFreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.zip
FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.tar.gz
Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next. Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson
Diffstat (limited to 'etc/rc.d/mountcritlocal')
-rwxr-xr-xetc/rc.d/mountcritlocal60
1 files changed, 49 insertions, 11 deletions
diff --git a/etc/rc.d/mountcritlocal b/etc/rc.d/mountcritlocal
index 38b75f4..9598f13 100755
--- a/etc/rc.d/mountcritlocal
+++ b/etc/rc.d/mountcritlocal
@@ -1,10 +1,12 @@
#!/bin/sh
#
-# $NetBSD: mountcritlocal,v 1.3 2000/07/26 00:11:49 lukem Exp $
+# $NetBSD: mountcritlocal,v 1.7 2002/04/29 12:29:53 lukem Exp $
+# $FreeBSD$
#
# PROVIDE: mountcritlocal
# REQUIRE: root
+# KEYWORD: FreeBSD NetBSD
. /etc/rc.subr
@@ -14,16 +16,52 @@ stop_cmd=":"
mountcritlocal_start()
{
- # mount critical local filesystems
- # (as specified in $critical_filesystems_beforenet)
- #
- mount_critical_filesystems local
-
- # clean up left-over files.
- # this could include the cleanup of lock files and /var/run, etc.
- #
- rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/*
- (cd /var/run && rm -rf -- *)
+ case `${CMD_OSTYPE}` in
+ FreeBSD)
+ # Set up the list of network filesystem types for which mounting
+ # should be delayed until after network initialization.
+ networkfs_types='nfs:NFS smbfs:SMB portalfs:PORTAL'
+ case ${extra_netfs_types} in
+ [Nn][Oo])
+ ;;
+ *)
+ networkfs_types="${networkfs_types} ${extra_netfs_types}"
+ ;;
+ esac
+
+ # Mount everything except nfs filesystems.
+ 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)
+ ;;
+ *)
+ echo 'Mounting /etc/fstab filesystems failed,' \
+ ' startup aborted'
+ exit 1
+ ;;
+ esac
+ ;;
+ NetBSD)
+ # Mount critical filesystems that are `local'
+ # (as specified in $critical_filesystems_local)
+ # This usually includes /var.
+ #
+ mount_critical_filesystems local
+
+ # clean up left-over files.
+ # this could include the cleanup of lock files and /var/run, etc.
+ #
+ rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/*
+ (cd /var/run && rm -rf -- *)
+ ;;
+ esac
}
load_rc_config $name
OpenPOWER on IntegriCloud