aboutsummaryrefslogtreecommitdiff
path: root/etc/network.subr
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>2002-01-28 11:05:01 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>2002-01-28 11:05:01 +0000
commit3e38757beb50daf1dfec007912885b9d34ed3a65 (patch)
tree3dfc19c0a4587ca39a17773b81e22b314aeb96a3 /etc/network.subr
parent831c910a3031b5684685ee51335adc7a407b09eb (diff)
downloadsrc-3e38757beb50daf1dfec007912885b9d34ed3a65.tar.gz
src-3e38757beb50daf1dfec007912885b9d34ed3a65.zip
Register amd's dependency on NFS.
This change was submitted to the freebsd-audit mailing list for review but received no feedback. Hindsight-enabled reviews are welcome. PR: conf/31358 Submitted: Thomas Quinot <thomas@cuivre.fr.eu.org>
Notes
Notes: svn path=/head/; revision=89911
Diffstat (limited to 'etc/network.subr')
-rw-r--r--etc/network.subr87
1 files changed, 51 insertions, 36 deletions
diff --git a/etc/network.subr b/etc/network.subr
index c75d57de8a30..730c0969327e 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -714,24 +714,59 @@ network_pass3() {
case ${nfs_client_enable} in
[Yy][Ee][Ss])
- if [ -n "${nfs_access_cache}" ]; then
- echo -n " NFS access cache time=${nfs_access_cache}"
- sysctl vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null
- fi
- if [ -n "${nfs_bufpackets}" ]; then
- sysctl vfs.nfs.bufpackets=${nfs_bufpackets} > /dev/null
+ nfsclient_in_kernel=0
+ # Handle absent nfs client support
+ if sysctl vfs.nfs >/dev/null 2>&1; then
+ nfsclient_in_kernel=1
+ else
+ kldload nfsclient && nfsclient_in_kernel=1
fi
- case ${rpc_statd_enable} in
- [Yy][Ee][Ss])
- echo -n ' rpc.statd'; rpc.statd
- ;;
- esac
- case ${rpc_lockd_enable} in
- [Yy][Ee][Ss])
- echo -n ' rpc.lockd'; rpc.lockd
- ;;
- esac
+ if [ ${nfsclient_in_kernel} -eq 1 ]
+ then
+ if [ -n "${nfs_access_cache}" ]; then
+ echo -n " NFS access cache time=${nfs_access_cache}"
+ sysctl vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null
+ fi
+ if [ -n "${nfs_bufpackets}" ]; then
+ sysctl vfs.nfs.bufpackets=${nfs_bufpackets} > /dev/null
+ fi
+ case ${rpc_statd_enable} in
+ [Yy][Ee][Ss])
+ echo -n ' rpc.statd'; rpc.statd
+ ;;
+ esac
+
+ case ${rpc_lockd_enable} in
+ [Yy][Ee][Ss])
+ echo -n ' rpc.lockd'; rpc.lockd
+ ;;
+ esac
+
+ case ${amd_enable} in
+ [Yy][Ee][Ss])
+ echo -n ' amd'
+ case ${amd_map_program} in
+ [Nn][Oo] | '')
+ ;;
+ *)
+ amd_flags="${amd_flags} `eval\
+ ${amd_map_program}`"
+ ;;
+ esac
+
+ if [ -n "${amd_flags}" ]; then
+ amd -p ${amd_flags}\
+ > /var/run/amd.pid 2> /dev/null
+ else
+ amd 2> /dev/null
+ fi
+ ;;
+ esac
+ else
+ echo 'Warning: NFS client kernel module failed to load'
+ nfs_client_enable=NO
+ fi
;;
esac
@@ -742,26 +777,6 @@ network_pass3() {
rpc.umntall -k
fi
- case ${amd_enable} in
- [Yy][Ee][Ss])
- echo -n ' amd'
- case ${amd_map_program} in
- [Nn][Oo] | '')
- ;;
- *)
- amd_flags="${amd_flags} `eval\
- ${amd_map_program}`"
- ;;
- esac
-
- if [ -n "${amd_flags}" ]; then
- amd -p ${amd_flags}\
- > /var/run/amd.pid 2> /dev/null
- else
- amd 2> /dev/null
- fi
- ;;
- esac
;;
esac