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.1 2003/07/24 06:35:37 dillon Exp $
8 # PROVIDE: mountcritremote
9 # REQUIRE: NETWORKING root mountcritlocal
10 # KEYWORD: DragonFly FreeBSD NetBSD
14 name="mountcritremote"
19 start_cmd="mountcritremote_start"
20 start_precmd="mountcritremote_precmd"
23 start_cmd="mountcritremote_start"
24 start_precmd="mountcritremote_precmd"
27 start_cmd="mountcritremote_start"
31 # Mount NFS filesystems if present in /etc/fstab
33 # XXX When the vfsload() issues with nfsclient support and related sysctls
34 # have been resolved, this block can be removed, and the condition that
35 # skips nfs in the following block (for "other network filesystems") can
38 mountcritremote_precmd()
40 case "`mount -d -a -t nfs 2> /dev/null`" in
42 # Handle absent nfs client support
43 if ! sysctl vfs.nfs >/dev/null 2>&1; then
44 kldload nfsclient || warn 'nfs mount ' \
45 'requested, but no nfs client in kernel' \
53 mountcritremote_start()
57 # Mount nfs filesystems.
59 echo -n 'Mounting NFS file systems:'
62 # Mount other network filesystems if present in /etc/fstab.
63 case ${extra_netfs_types} in
67 netfs_types="${netfs_types} ${extra_netfs_types}"
70 for i in ${netfs_types}; do
73 [ "${fstype}" = "nfs" ] && continue
74 case "`mount -d -a -t ${fstype}`" in
76 echo -n "Mounting ${fsdecr} file systems:"
83 # Cleanup /var again just in case it's a network mount.
84 /etc/rc.d/cleanvar reload
85 rm -f /var/run/clean_var /var/spool/lock/clean_var
90 # Mount nfs filesystems.
92 echo -n 'Mounting NFS file systems:'
96 # Mount other network filesystems if present in /etc/fstab.
97 case ${extra_netfs_types} in
101 netfs_types="${netfs_types} ${extra_netfs_types}"
105 for i in ${netfs_types}; do
109 [ "${fstype}" = "nfs" ] && continue
111 case "`mount -d -a -t ${fstype}`" in
113 echo -n "Mounting ${fsdecr} file systems:"
114 mount -a -t ${fstype}
120 # Cleanup /var again just in case it's a network mount.
121 /etc/rc.d/cleanvar reload
122 rm -f /var/run/clean_var /var/spool/lock/clean_var
125 # Mount critical filesystems that may be `remote'.
126 # (as specified in $critical_filesystems_remote)
127 # This usually includes /usr.
129 mount_critical_filesystems remote