178344Sobrien#!/bin/sh
278344Sobrien#
398184Sgordon# $FreeBSD$
478344Sobrien#
578344Sobrien
678344Sobrien# PROVIDE: mountcritlocal
7208307Sdougb# REQUIRE: root hostid_save mdconfig
8215824Sdougb# KEYWORD: nojail shutdown
978344Sobrien
1078344Sobrien. /etc/rc.subr
1178344Sobrien
1278344Sobrienname="mountcritlocal"
1378344Sobrienstart_cmd="mountcritlocal_start"
14215824Sdougbstop_cmd=sync
1578344Sobrien
1678344Sobrienmountcritlocal_start()
1778344Sobrien{
18176873Smtm	local err
19176873Smtm
20124618Smtm	# Set up the list of network filesystem types for which mounting
21124618Smtm	# should be delayed until after network initialization.
22124618Smtm	case ${extra_netfs_types} in
23124618Smtm	[Nn][Oo])
24124618Smtm		;;
25124618Smtm	*)
26124618Smtm		netfs_types="${netfs_types} ${extra_netfs_types}"
27124618Smtm		;;
28124618Smtm	esac
2978344Sobrien
30124618Smtm	# Mount everything except nfs filesystems.
31197947Sdougb	check_startmsgs && echo -n 'Mounting local file systems:'
32124618Smtm	mount_excludes='no'
33124618Smtm	for i in ${netfs_types}; do
34124618Smtm		fstype=${i%:*}
35124618Smtm		mount_excludes="${mount_excludes}${fstype},"
36124618Smtm	done
37124618Smtm	mount_excludes=${mount_excludes%,}
38124618Smtm	mount -a -t ${mount_excludes}
39176873Smtm	err=$?
40197947Sdougb	check_startmsgs && echo '.'
4198184Sgordon
42176873Smtm	case ${err} in
43124618Smtm	0)
4498184Sgordon		;;
45124618Smtm	*)
46124618Smtm		echo 'Mounting /etc/fstab filesystems failed,' \
47124618Smtm		    ' startup aborted'
48169668Smtm		stop_boot true
4998184Sgordon		;;
5098184Sgordon	esac
5178344Sobrien}
5278344Sobrien
5378344Sobrienload_rc_config $name
5478344Sobrienrun_rc_command "$1"
55