From owner-freebsd-audit Thu Jan 17 9:32:29 2002 Delivered-To: freebsd-audit@freebsd.org Received: from melchior.cuivre.fr.eu.org (melchior.enst.fr [137.194.161.6]) by hub.freebsd.org (Postfix) with ESMTP id BE28937B417 for ; Thu, 17 Jan 2002 09:32:23 -0800 (PST) Received: from melusine.cuivre.fr.eu.org (melusine.enst.fr [137.194.160.34]) by melchior.cuivre.fr.eu.org (Postfix) with ESMTP id 1C3938243 for ; Thu, 17 Jan 2002 18:32:22 +0100 (CET) Received: by melusine.cuivre.fr.eu.org (Postfix, from userid 1000) id BCA087B; Thu, 17 Jan 2002 18:32:21 +0100 (CET) Date: Thu, 17 Jan 2002 18:32:21 +0100 From: Thomas Quinot To: freebsd-audit@freebsd.org Subject: conf/31358: NFS and amd startup fixes Message-ID: <20020117183221.A87451@melusine.cuivre.fr.eu.org> Reply-To: thomas@cuivre.fr.eu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi auditors, I'd be interested in a review and test feeback of the attached patch, which addresses the two issues raised by PR conf/31358: * when enabling amd, nfsclient needs to be enabled as well; * when nfsclient is enabled, the LKM needs to be loaded if the code was not compiled into the kernel. Thanks, Thomas. diff -u {/usr/src,}/etc/rc --- /usr/src/etc/rc Fri Jan 4 14:35:43 2002 +++ /etc/rc Tue Jan 8 18:06:12 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 18:06:30 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 -- Thomas.Quinot@Cuivre.FR.EU.ORG To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message