1160303Sdes#!/bin/sh
2160303Sdes#
3160303Sdes# $FreeBSD$
4160303Sdes#
5160303Sdes
6160303Sdes# PROVIDE: mountlate
7160303Sdes# REQUIRE: DAEMON
8160303Sdes# BEFORE: LOGIN
9160303Sdes# KEYWORD: nojail
10160303Sdes
11160303Sdes. /etc/rc.subr
12160303Sdes
13160303Sdesname="mountlate"
14298514Slmedesc="Mount filesystems with \"late\" option from /etc/fstab"
15160303Sdesstart_cmd="mountlate_start"
16160303Sdesstop_cmd=":"
17160303Sdes
18160303Sdesmountlate_start()
19160303Sdes{
20179928Smtm	local err latefs
21176873Smtm
22160303Sdes	# Mount "late" filesystems.
23179928Smtm	#
24179928Smtm	err=0
25298514Slme	echo -n 'Mounting late filesystems:'
26250235Screes	mount -a -L
27250235Screes	err=$?
28250235Screes	echo '.'
29160303Sdes
30176873Smtm	case ${err} in
31160303Sdes	0)
32160303Sdes		;;
33160303Sdes	*)
34160303Sdes		echo 'Mounting /etc/fstab filesystems failed,' \
35160303Sdes		    ' startup aborted'
36169668Smtm		stop_boot true
37160303Sdes		;;
38160303Sdes	esac
39177061Sdelphij
40177061Sdelphij 	# If we booted a special kernel remove the record
41177061Sdelphij 	# so we will boot the default kernel next time.
42177061Sdelphij 	if [ -x /sbin/nextboot ]; then
43177061Sdelphij		/sbin/nextboot -D
44177061Sdelphij 	fi
45160303Sdes}
46160303Sdes
47160303Sdesload_rc_config $name
48160303Sdesrun_rc_command "$1"
49