Date: Tue, 8 Jan 2002 05:00:02 -0800 (PST) From: Thomas Quinot <quinot@inf.enst.fr> To: freebsd-bugs@FreeBSD.org Subject: Re: conf/31358: Updated patch for -CURRENT Message-ID: <200201081300.g08D02k43018@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/31358; it has been noted by GNATS. From: Thomas Quinot <quinot@inf.enst.fr> To: Mike Makonnen <mike_makonnen@yahoo.com> Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: conf/31358: Updated patch for -CURRENT Date: Tue, 8 Jan 2002 13:57:35 +0100 Le 2002-01-08, Mike Makonnen écrivait : > You should clean this up so there is only *one* 'case "${nfs_client_enable}"'. > Look at the implementation of case ${nfs_server_enable}, earlier in rc.network for an example of how it should be done. Thanks for your feedback! Does the following look more appropriate? diff -u {/usr/src,}/etc/rc --- /usr/src/etc/rc Fri Jan 4 14:35:43 2002 +++ /etc/rc Tue Jan 8 11:11:56 2002 @@ -103,6 +103,7 @@ } chkdepend amd amd_enable portmap portmap_enable +chkdepend amd amd_enable NFS nfs_client_enable chkdepend NFS nfs_server_enable portmap portmap_enable chkdepend NIS nis_server_enable portmap portmap_enable chkdepend NIS nis_client_enable portmap portmap_enable diff -u {/usr/src,}/etc/rc.network --- /usr/src/etc/rc.network Fri Jan 4 14:35:44 2002 +++ /etc/rc.network Tue Jan 8 13:54:05 2002 @@ -714,24 +714,59 @@ 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 + 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 - if [ -n "${nfs_bufpackets}" ]; then - sysctl vfs.nfs.bufpackets=${nfs_bufpackets} > /dev/null + + 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 - 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 ;; esac @@ -742,26 +777,6 @@ 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201081300.g08D02k43018>