summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/mountcritlocal
blob: 06bf464f239f480be0bffca4ed0ccee7c74b6e90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: mountcritlocal
# REQUIRE: root hostid_save mdconfig
# KEYWORD: nojail shutdown

. /etc/rc.subr

name="mountcritlocal"
start_cmd="mountcritlocal_start"
stop_cmd=sync

mountcritlocal_start()
{
	local err

	# Set up the list of network filesystem types for which mounting
	# should be delayed until after network initialization.
	case ${extra_netfs_types} in
	[Nn][Oo])
		;;
	*)
		netfs_types="${netfs_types} ${extra_netfs_types}"
		;;
	esac

	# Mount everything except nfs filesystems.
	check_startmsgs && echo -n 'Mounting local file systems:'
	mount_excludes='no'
	for i in ${netfs_types}; do
		fstype=${i%:*}
		mount_excludes="${mount_excludes}${fstype},"
	done
	mount_excludes=${mount_excludes%,}
	mount -a -t ${mount_excludes}
	err=$?
	check_startmsgs && echo '.'

	case ${err} in
	0)
		;;
	*)
		echo 'Mounting /etc/fstab filesystems failed,' \
		    ' startup aborted'
		stop_boot true
		;;
	esac
}

load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud