freebsd-dev/etc/rc.d/mountlate
Dag-Erling Smørgrav 4b4f91707c Teach mount(8) about a 'late' keyword, which means the file system should
not be mounted unless the -l flag was specified.

Add an rc script, mountlate, which basically runs 'mount -a -l'.  It runs
after DAEMON but before LOGIN.

This is useful for things like loopback mounts, because mountcritremote
runs before mountd  / nfsd (since /usr might be a remote file system), so
an attempt to mount a loopback network file system in mountcritremote will
fail.

Also add a progress message to mountcritlocal, for the sake of symmetry
with similar messages in mountcritremote and mountlate.

Reviewed by:	freebsd-rc
MFC after:	3 weeks
2006-07-12 16:05:51 +00:00

37 lines
460 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: mountlate
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: nojail
. /etc/rc.subr
name="mountlate"
start_cmd="mountlate_start"
stop_cmd=":"
mountlate_start()
{
# Mount "late" filesystems.
echo -n 'Mounting late file systems:'
mount -a -l
echo '.'
case $? in
0)
;;
*)
echo 'Mounting /etc/fstab filesystems failed,' \
' startup aborted'
kill -QUIT $$
;;
esac
}
load_rc_config $name
run_rc_command "$1"