NFS - Fix remaining VM/BIO issues
[dragonfly.git] / etc / rc.d / mountcritremote
blob2d135484833f1b0651f1c94afc4f7b80b655b15b
1 #!/bin/sh
3 # $NetBSD: mountcritremote,v 1.7 2002/04/29 12:29:53 lukem Exp $
4 # $FreeBSD: src/etc/rc.d/mountcritremote,v 1.6 2003/06/01 01:43:37 gordon Exp $
5 # $DragonFly: src/etc/rc.d/mountcritremote,v 1.6 2005/11/19 21:47:32 swildner Exp $
8 # PROVIDE: mountcritremote
9 # REQUIRE: NETWORKING root mountcritlocal
11 . /etc/rc.subr
13 name="mountcritremote"
14 stop_cmd=":"
16 start_cmd="mountcritremote_start"
17 start_precmd="mountcritremote_precmd"
19 # Mount NFS filesystems if present in /etc/fstab
21 # XXX When the vfsload() issues with nfsclient support and related sysctls
22 # have been resolved, this block can be removed, and the condition that
23 # skips nfs in the following block (for "other network filesystems") can
24 # be removed.
26 mountcritremote_precmd()
28 case "`mount -d -a -t nfs 2> /dev/null`" in
29 *mount_nfs*)
30 # Handle absent nfs client support
31 if ! sysctl vfs.nfs >/dev/null 2>&1; then
32 kldload nfs || warn 'nfs mount ' \
33 'requested, but no nfs client in kernel' \
34 return 1
37 esac
38 return 0
41 mountcritremote_start()
43 # Mount nfs filesystems.
45 echo -n 'Mounting NFS file systems:'
46 mount -a -t nfs
47 echo '.'
48 # Mount other network filesystems if present in /etc/fstab.
49 case ${extra_netfs_types} in
50 [Nn][Oo])
53 netfs_types="${netfs_types} ${extra_netfs_types}"
55 esac
56 for i in ${netfs_types}; do
57 fstype=${i%:*}
58 fsdecr=${i#*:}
59 [ "${fstype}" = "nfs" ] && continue
60 case "`mount -d -a -t ${fstype}`" in
61 *mount_${fstype}*)
62 echo -n "Mounting ${fsdecr} file systems:"
63 mount -a -t ${fstype}
64 echo '.'
66 esac
67 done
69 # Cleanup /var again just in case it's a network mount.
70 /etc/rc.d/cleanvar reload
71 rm -f /var/run/clean_var /var/spool/lock/clean_var
74 load_rc_config $name
75 run_rc_command "$1"