Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2002 19:15:56 +0100
From:      Thomas Quinot <thomas@cuivre.fr.eu.org>
To:        stable@freebsd.org
Subject:   Re: conf/31358: Need to load NFS client LKM [MFC]
Message-ID:  <20020206191556.A50292@melusine.cuivre.fr.eu.org>

next in thread | raw e-mail | index | archive | help
Folks,

Some time ago I submitted a PR on situations where the nfsclient
module needs to be loaded from /etc/rc.network (conf/31358).
The proposed patch has been committed to current; I have prepared
a patch for a possible MFC into 4-STABLE; tests and reviews on the
code below would be most welcome.

Thanks for any feedback,
Thomas.

Index: rc
===================================================================
RCS file: /home/ncvs/src/etc/rc,v
retrieving revision 1.212.2.38
diff -u -r1.212.2.38 rc
--- rc	19 Dec 2001 17:52:17 -0000	1.212.2.38
+++ rc	31 Jan 2002 21:30:35 -0000
@@ -98,6 +98,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
Index: rc.network
===================================================================
RCS file: /home/ncvs/src/etc/rc.network,v
retrieving revision 1.74.2.28
diff -u -r1.74.2.28 rc.network
--- rc.network	19 Dec 2001 17:52:17 -0000	1.74.2.28
+++ rc.network	31 Jan 2002 21:30:36 -0000
@@ -695,11 +695,39 @@
 
 	case ${nfs_client_enable} in
 	[Yy][Ee][Ss])
-		echo -n ' nfsiod';	nfsiod ${nfs_client_flags}
-		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 [ ${nfsclient_in_kernel} -eq 1 ]
+		then
+			echo -n ' nfsiod';	nfsiod ${nfs_client_flags}
+			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
+
+			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
 		fi
 		;;
 	esac
@@ -710,25 +738,6 @@
 	if [ -f /var/db/mounttab ]; then
 		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
 
 	case ${rwhod_enable} in
 	[Yy][Ee][Ss])

-- 
    Thomas.Quinot@Cuivre.FR.EU.ORG

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020206191556.A50292>