5 # PROVIDE: mountcritremote
6 # REQUIRE: NETWORKING FILESYSTEMS ipsec netwait nfscbd
11 name="mountcritremote"
12 desc="Mount critical remote filesystems"
14 start_cmd="mountcritremote_start"
15 start_precmd="mountcritremote_precmd"
17 # Mount NFS filesystems if present in /etc/fstab
19 # XXX When the vfsload() issues with nfsclient support and related sysctls
20 # have been resolved, this block can be removed, and the condition that
21 # skips nfs in the following block (for "other network filesystems") can
24 mountcritremote_precmd()
26 case "`mount -d -a -t nfs 2> /dev/null`" in
28 # Handle absent nfs client support
29 load_kld -m nfs nfscl || return 1
35 mountcritremote_start()
37 local mounted_remote_filesystem=false
39 # Mount nfs filesystems.
41 case "`/sbin/mount -d -a -t nfs`" in
45 mounted_remote_filesystem=true
46 echo -n 'Mounting NFS filesystems:'
52 # Mount other network filesystems if present in /etc/fstab.
53 case ${extra_netfs_types} in
57 netfs_types="${netfs_types} ${extra_netfs_types}"
61 for i in ${netfs_types}; do
65 [ "${fstype}" = "nfs" ] && continue
67 case "`mount -d -a -t ${fstype}`" in
69 mounted_remote_filesystem=true
70 echo -n "Mounting ${fsdecr} filesystems:"
77 if $mounted_remote_filesystem; then
78 # Cleanup /var again just in case it's a network mount.
79 /etc/rc.d/cleanvar quietreload
80 rm -f /var/run/clean_var /var/spool/lock/clean_var
82 # Regenerate the ldconfig hints in case there are additional
83 # library paths on remote file systems
84 /etc/rc.d/ldconfig quietstart