diff options
author | des <des@FreeBSD.org> | 2006-07-12 16:05:51 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2006-07-12 16:05:51 +0000 |
commit | 72b19002fe39572d46b16b35d90b9d58e7b696ec (patch) | |
tree | 9cc82f8d6cdb6dffe60dd823237ba04471feefa3 /etc/rc.d | |
parent | f82e9588d84ff8322c2063e9e0e1df59b4d8a184 (diff) | |
download | FreeBSD-src-72b19002fe39572d46b16b35d90b9d58e7b696ec.zip FreeBSD-src-72b19002fe39572d46b16b35d90b9d58e7b696ec.tar.gz |
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
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-x | etc/rc.d/mountcritlocal | 2 | ||||
-rw-r--r-- | etc/rc.d/mountlate | 36 |
2 files changed, 38 insertions, 0 deletions
diff --git a/etc/rc.d/mountcritlocal b/etc/rc.d/mountcritlocal index 49f1ba9..20d2473 100755 --- a/etc/rc.d/mountcritlocal +++ b/etc/rc.d/mountcritlocal @@ -27,6 +27,7 @@ mountcritlocal_start() esac # Mount everything except nfs filesystems. + echo -n 'Mounting local file systems:' mount_excludes='no' for i in ${netfs_types}; do fstype=${i%:*} @@ -34,6 +35,7 @@ mountcritlocal_start() done mount_excludes=${mount_excludes%,} mount -a -t ${mount_excludes} + echo '.' case $? in 0) diff --git a/etc/rc.d/mountlate b/etc/rc.d/mountlate new file mode 100644 index 0000000..1d4e33f --- /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" |