diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-07-12 16:05:51 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-07-12 16:05:51 +0000 |
commit | 4b4f91707ce02c94d5b298b9194fb074793c0733 (patch) | |
tree | 9cc82f8d6cdb6dffe60dd823237ba04471feefa3 /etc/rc.d/mountlate | |
parent | 7f5932be3ee549f95d7231ea0324d3fab1d90677 (diff) | |
download | src-4b4f91707ce02c94d5b298b9194fb074793c0733.tar.gz src-4b4f91707ce02c94d5b298b9194fb074793c0733.zip |
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
Notes
Notes:
svn path=/head/; revision=160303
Diffstat (limited to 'etc/rc.d/mountlate')
-rw-r--r-- | etc/rc.d/mountlate | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/etc/rc.d/mountlate b/etc/rc.d/mountlate new file mode 100644 index 000000000000..1d4e33f401a1 --- /dev/null +++ b/etc/rc.d/mountlate @@ -0,0 +1,36 @@ +#!/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" |