1253009Sedwin#!/bin/sh
2253009Sedwin#
3192886Sedwin# $FreeBSD: releng/10.2/etc/rc.d/mountcritlocal 215824 2010-11-25 18:20:28Z dougb $
4192886Sedwin#
558787Sru
6257697Sedwin# PROVIDE: mountcritlocal
719874Swollman# REQUIRE: root hostid_save mdconfig
8257697Sedwin# KEYWORD: nojail shutdown
9257697Sedwin
10257697Sedwin. /etc/rc.subr
11257697Sedwin
12257697Sedwinname="mountcritlocal"
13257697Sedwinstart_cmd="mountcritlocal_start"
14257697Sedwinstop_cmd=sync
15257697Sedwin
1619874Swollmanmountcritlocal_start()
1719874Swollman{
1819874Swollman	local err
1919874Swollman
20253009Sedwin	# Set up the list of network filesystem types for which mounting
21257697Sedwin	# should be delayed until after network initialization.
22257697Sedwin	case ${extra_netfs_types} in
2319874Swollman	[Nn][Oo])
2486222Swollman		;;
2519874Swollman	*)
2619874Swollman		netfs_types="${netfs_types} ${extra_netfs_types}"
2719874Swollman		;;
28257697Sedwin	esac
2919874Swollman
30257697Sedwin	# Mount everything except nfs filesystems.
3119874Swollman	check_startmsgs && echo -n 'Mounting local file systems:'
32253009Sedwin	mount_excludes='no'
33253009Sedwin	for i in ${netfs_types}; do
34253009Sedwin		fstype=${i%:*}
35253009Sedwin		mount_excludes="${mount_excludes}${fstype},"
3619874Swollman	done
3719874Swollman	mount_excludes=${mount_excludes%,}
3819874Swollman	mount -a -t ${mount_excludes}
3919874Swollman	err=$?
4019874Swollman	check_startmsgs && echo '.'
4119874Swollman
4219874Swollman	case ${err} in
4319874Swollman	0)
4419874Swollman		;;
4519874Swollman	*)
46257697Sedwin		echo 'Mounting /etc/fstab filesystems failed,' \
47114173Swollman		    ' startup aborted'
4837998Sdes		stop_boot true
4937998Sdes		;;
5043014Swollman	esac
5119874Swollman}
52213312Sedwin
53171948Sedwinload_rc_config $name
5458787Srurun_rc_command "$1"
55263906Sedwin