summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2001-10-19 06:50:52 +0000
committerdougb <dougb@FreeBSD.org>2001-10-19 06:50:52 +0000
commit2d4b0d066d5e32c2701543e212e460819076cf93 (patch)
tree5a57b7cd7dc4e20b37f96bec6cef5dca0ffdacce /etc/rc
parentad52e8338dc5073d23b96860d4f52e3df9cfe998 (diff)
downloadFreeBSD-src-2d4b0d066d5e32c2701543e212e460819076cf93.zip
FreeBSD-src-2d4b0d066d5e32c2701543e212e460819076cf93.tar.gz
Handle the lack of nfs server or client support in the kernel by
kldload'ing the appropriate modules before enabling the service.
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc21
1 files changed, 18 insertions, 3 deletions
diff --git a/etc/rc b/etc/rc
index 439d577..557146b 100644
--- a/etc/rc
+++ b/etc/rc
@@ -406,9 +406,24 @@ esac
# Mount NFS filesystems if present in /etc/fstab
case "`mount -d -a -t nfs 2> /dev/null`" in
*mount_nfs*)
- echo -n 'Mounting NFS file systems:'
- mount -a -t nfs
- echo '.'
+ # Handle absent nfs client support
+ nfsclient_in_kernel=0
+ if sysctl vfs.nfs >/dev/null 2>&1; then
+ nfsclient_in_kernel=1
+ else
+ kldload nfsclient && nfsclient_in_kernel=1
+ fi
+
+ case ${nfsclient_in_kernel} in
+ 1)
+ echo -n 'Mounting NFS file systems:'
+ mount -a -t nfs
+ echo '.'
+ ;;
+ *)
+ echo 'Warning: nfs mount requested, but no nfs client in kernel'
+ ;;
+ esac
;;
esac
OpenPOWER on IntegriCloud