1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# PROVIDE: mountcritlocal
7# REQUIRE: root hostid_save mdconfig
8# KEYWORD: nojail shutdown
9
10. /etc/rc.subr
11
12name="mountcritlocal"
13start_cmd="mountcritlocal_start"
14stop_cmd=sync
15
16mountcritlocal_start()
17{
18	local err
19
20	# Set up the list of network filesystem types for which mounting
21	# should be delayed until after network initialization.
22	case ${extra_netfs_types} in
23	[Nn][Oo])
24		;;
25	*)
26		netfs_types="${netfs_types} ${extra_netfs_types}"
27		;;
28	esac
29
30	# Mount everything except nfs filesystems.
31	check_startmsgs && echo -n 'Mounting local file systems:'
32	mount_excludes='no'
33	for i in ${netfs_types}; do
34		fstype=${i%:*}
35		mount_excludes="${mount_excludes}${fstype},"
36	done
37	mount_excludes=${mount_excludes%,}
38	mount -a -t ${mount_excludes}
39	err=$?
40	check_startmsgs && echo '.'
41
42	case ${err} in
43	0)
44		;;
45	*)
46		echo 'Mounting /etc/fstab filesystems failed,' \
47		    ' startup aborted'
48		stop_boot true
49		;;
50	esac
51}
52
53load_rc_config $name
54run_rc_command "$1"
55