6 # PROVIDE: mountcritremote
7 # REQUIRE: NETWORKING FILESYSTEMS ipsec netwait
12 name="mountcritremote"
13 desc="Mount critical remote filesystems"
15 start_cmd="mountcritremote_start"
16 start_precmd="mountcritremote_precmd"
18 # Mount NFS filesystems if present in /etc/fstab
20 # XXX When the vfsload() issues with nfsclient support and related sysctls
21 # have been resolved, this block can be removed, and the condition that
22 # skips nfs in the following block (for "other network filesystems") can
25 mountcritremote_precmd()
27 case "`mount -d -a -t nfs 2> /dev/null`" in
29 # Handle absent nfs client support
30 load_kld -m nfs nfscl || return 1
36 mountcritremote_start()
38 local mounted_remote_filesystem=false
40 # Mount nfs filesystems.
42 case "`/sbin/mount -d -a -t nfs`" in
46 mounted_remote_filesystem=true
47 echo -n 'Mounting NFS filesystems:'
53 # Mount other network filesystems if present in /etc/fstab.
54 case ${extra_netfs_types} in
58 netfs_types="${netfs_types} ${extra_netfs_types}"
62 for i in ${netfs_types}; do
66 [ "${fstype}" = "nfs" ] && continue
68 case "`mount -d -a -t ${fstype}`" in
70 mounted_remote_filesystem=true
71 echo -n "Mounting ${fsdecr} filesystems:"
78 if $mounted_remote_filesystem; then
79 # Cleanup /var again just in case it's a network mount.
80 /etc/rc.d/cleanvar quietreload
81 rm -f /var/run/clean_var /var/spool/lock/clean_var
83 # Regenerate the ldconfig hints in case there are additional
84 # library paths on remote file systems
85 /etc/rc.d/ldconfig quietstart