conf/31358: Updated patch for -CURRENT
Attached to this email is an update to the patch supplied with PR conf/31358, which fixes two issues: * amd can only be started when NFS client is enabled; * when nfs_client_enable is set and no NFS file systems are mounted at boot time from /etc/fstab, rc.network needs to ensure that the nfsclient module is loaded. Can someone please take a look at this PR? Thanks, Thomas. diff -u ../rc rc --- ../rc Tue Jan 8 10:11:48 2002 +++ rc Tue Jan 8 10:42:38 2002 @@ -103,6 +103,7 @@ } chkdepend amd amd_enableportmap portmap_enable +chkdepend amd amd_enableNFSnfs_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 ../rc.network rc.network --- ../rc.network Tue Jan 8 10:11:48 2002 +++ rc.network Tue Jan 8 10:57:58 2002 @@ -712,8 +712,30 @@ ;; esac + # Handle absent nfs client support + if sysctl vfs.nfs /dev/null 21; then + nfsclient_in_kernel=1 + else + nfsclient_in_kernel=0 + fi + case ${nfs_client_enable} in [Yy][Ee][Ss]) + kldload nfsclient nfsclient_in_kernel=1 + + case $nfsclient_in_kernel in + 1) + ;; + *) + echo 'Warning: NFS client kernel module failed to load' + nfs_client_enable=NO + ;; + esac + ;; + esac + + 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 @@ -732,6 +754,27 @@ 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 ;; esac @@ -742,26 +785,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 ** Département Informatique Réseaux ** [EMAIL PROTECTED] ENST // 46 rue Barrault // 75634 PARIS CEDEX 13 To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: conf/31358: Updated patch for -CURRENT
Le 2002-01-08, Thomas Quinot écrivait : case ${nfs_client_enable} in [Yy][Ee][Ss]) +kldload nfsclient nfsclient_in_kernel=1 Ooops, this is *far* too aggressive! Here is a corrected version of the previous patch. Sorry! diff -u ../rc rc --- ../rc Tue Jan 8 10:11:48 2002 +++ rc Tue Jan 8 10:42:38 2002 @@ -103,6 +103,7 @@ } chkdepend amd amd_enableportmap portmap_enable +chkdepend amd amd_enableNFSnfs_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 ../rc.network rc.network --- ../rc.network Tue Jan 8 10:11:48 2002 +++ rc.network Tue Jan 8 11:12:14 2002 @@ -712,8 +712,33 @@ ;; esac + # Handle absent nfs client support + if sysctl vfs.nfs /dev/null 21; then + nfsclient_in_kernel=1 + else + nfsclient_in_kernel=0 + fi + case ${nfs_client_enable} in [Yy][Ee][Ss]) + case $nfsclient_in_kernel in + 1) + ;; + *) + if kldload nfsclient + then + nfsclient_in_kernel=1 + else + echo 'Warning: NFS client kernel module failed +to load' + nfs_client_enable=NO + fi + ;; + esac + ;; + esac + + 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 @@ -732,6 +757,27 @@ 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 ;; esac @@ -742,26 +788,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 ** Département Informatique Réseaux ** [EMAIL PROTECTED] ENST // 46 rue Barrault // 75634 PARIS CEDEX 13 To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: conf/31358: Updated patch for -CURRENT
On Tue, 8 Jan 2002 11:02:06 +0100 Thomas Quinot [EMAIL PROTECTED] wrote: [snip] + # Handle absent nfs client support + if sysctl vfs.nfs /dev/null 21; then + nfsclient_in_kernel=1 + else + nfsclient_in_kernel=0 + fi + This should be handled inside the case statement for ${nfs_client_enable}, as you want to load the nfsclient kld only if the nfs client is enabled. case ${nfs_client_enable} in [Yy][Ee][Ss]) + kldload nfsclient nfsclient_in_kernel=1 + + case $nfsclient_in_kernel in + 1) + ;; + *) + echo 'Warning: NFS client kernel module failed to load' + nfs_client_enable=NO + ;; + esac + ;; + esac + + 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 @@ -732,6 +754,27 @@ echo -n ' rpc.lockd'; rpc.lockd ;; esac 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. Cheers, mike makonnen To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: conf/31358: Updated patch for -CURRENT
Le 2002-01-08, Sheldon Hearn écrivait : Nits follow: [ whitespace ] [ style ] I'd suggest getting your patch tested by -CURRENT users by posting the patch to the freebsd-current mailing list. I have produced a new diff that incorporates the changes suggested by Sheldon. Those interested can fetch it from http://www.cuivre.fr.eu.org/~thomas/31358.diff Thomas. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message