From c8bf94da48b4e969fb0fdb65ee0e3abe52eeafd4 Mon Sep 17 00:00:00 2001 From: sheldonh Date: Mon, 28 Jan 2002 11:05:01 +0000 Subject: 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 --- etc/rc.network | 87 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 36 deletions(-) (limited to 'etc/rc.network') diff --git a/etc/rc.network b/etc/rc.network index c75d57d..730c096 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -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 -- cgit v1.1