Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 2009 14:21:38 -0400 (EDT)
From:      Rick Macklem <rick@snowhite.cis.uoguelph.ca>
To:        dougb@FreeBSD.org
Cc:        rwatson@FreeBSD.org, rc@FreeBSD.org, kib@FreeBSD.org
Subject:   Re: rc scripts for the new experimental nfs subsystem
Message-ID:  <200905311821.OAA47980@snowhite.cis.uoguelph.ca>

next in thread | raw e-mail | index | archive | help
[good stuff snipped]
> It sounds like what you really want to do is have nfsd REQUIRE nfsuserd.
> 
> I'll only comment on a few things, the rest looks good.

Thanks a lot for the review. I've used your version of nfsd, which I think
is more readable and moved the sig_stop lines up like you suggested. I've
added nfsuserd to the REQUIRE: line in nfsd and also in nfscbd.

So, I think it's ready for a commit. (I've attached the diff again, just in
case you want to take another look.)

Thanks again, rick
--- diff -u of rc scripts ---
diff -u -r -N rc.d.sav/mountd rc.d/mountd
--- rc.d.sav/mountd	2009-05-28 14:59:22.000000000 -0400
+++ rc.d/mountd	2009-05-30 20:25:04.000000000 -0400
@@ -37,6 +37,13 @@
 		fi
 	fi
 
+	# If nfsv4_server_enable is yes, force use of the experimental
+	# server
+	#
+	if checkyesno nfsv4_server_enable; then
+		rc_flags="-e ${rc_flags}"
+	fi
+
 	if checkyesno zfs_enable; then
 		rc_flags="${rc_flags} /etc/exports /etc/zfs/exports"
 	fi
diff -u -r -N rc.d.sav/nfscbd rc.d/nfscbd
--- rc.d.sav/nfscbd	1969-12-31 19:00:00.000000000 -0500
+++ rc.d/nfscbd	2009-05-31 14:01:20.000000000 -0400
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: nfscbd
+# REQUIRE: NETWORKING nfsuserd
+# KEYWORD: nojail shutdown
+
+. /etc/rc.subr
+
+name="nfscbd"
+rcvar=`set_rcvar`
+command="/usr/sbin/${name}"
+sig_stop="USR1"
+
+load_rc_config $name
+
+run_rc_command "$1"
diff -u -r -N rc.d.sav/nfsd rc.d/nfsd
--- rc.d.sav/nfsd	2009-05-28 14:59:22.000000000 -0400
+++ rc.d/nfsd	2009-05-30 20:31:23.000000000 -0400
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: nfsd
-# REQUIRE: mountd hostname gssd
+# REQUIRE: mountd hostname gssd nfsuserd
 # KEYWORD: nojail shutdown
 
 . /etc/rc.subr
@@ -14,14 +14,33 @@
 command="/usr/sbin/${name}"
 
 load_rc_config $name
-command_args="${nfs_server_flags}"
 start_precmd="nfsd_precmd"
 sig_stop="USR1"
 
 nfsd_precmd()
 {
-	if ! sysctl vfs.nfsrv >/dev/null 2>&1; then
-		force_depend nfsserver || return 1
+	if checkyesno nfsv4_server_enable; then
+		# If nfsv4_server_enable is yes, force use
+		# of the experimental server
+		#
+		rc_flags="-e ${nfs_server_flags}"
+
+		if ! checkyesno nfsuserd_enable  && \
+		    ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1
+		then
+			force_depend nfsuserd || return 1
+		fi
+	else
+		rc_flags="${nfs_server_flags}"
+
+		if ! sysctl vfs.nfsrv >/dev/null 2>&1; then
+			force_depend nfsserver || return 1
+		fi
+
+		if checkyesno nfs_reserved_port_only; then
+			echo 'NFS on reserved port only=YES'
+			sysctl vfs.nfsrv.nfs_privport=1 > /dev/null
+		fi
 	fi
 
 	if ! checkyesno rpcbind_enable  && \
@@ -35,11 +54,6 @@
 	then
 		force_depend mountd || return 1
 	fi
-
-	if checkyesno nfs_reserved_port_only; then
-		echo 'NFS on reserved port only=YES'
-		sysctl vfs.nfsrv.nfs_privport=1 > /dev/null
-	fi
 	return 0
 }
 
diff -u -r -N rc.d.sav/nfsuserd rc.d/nfsuserd
--- rc.d.sav/nfsuserd	1969-12-31 19:00:00.000000000 -0500
+++ rc.d/nfsuserd	2009-05-30 20:32:45.000000000 -0400
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: nfsuserd
+# REQUIRE: NETWORKING
+# KEYWORD: nojail shutdown
+
+. /etc/rc.subr
+
+name="nfsuserd"
+rcvar=`set_rcvar`
+command="/usr/sbin/${name}"
+sig_stop="USR1"
+
+load_rc_config $name
+
+run_rc_command "$1"
diff -u -r -N rc.d.sav/rc.conf rc.d/rc.conf
--- rc.d.sav/rc.conf	2009-05-31 14:13:38.000000000 -0400
+++ rc.d/rc.conf	2009-05-31 14:12:46.000000000 -0400
@@ -311,6 +311,11 @@
 rpc_ypupdated_enable="NO"	# Run if NIS master and SecureRPC (or NO).
 keyserv_enable="NO"		# Run the SecureRPC keyserver (or NO).
 keyserv_flags=""		# Flags to keyserv (if enabled).
+nfsv4_server_enable="NO"	# Enable support for NFSv4
+nfscbd_enable="NO"		# NFSv4 client side callback daemon
+nfscbd_flags=""			# Flags for nfscbd
+nfsuserd_enable="NO"		# NFSv4 user/group name mapping daemon
+nfsuserd_flags=""		# Flags for nfsuserd
 
 ### Network Time Services options: ###
 timed_enable="NO"		# Run the time daemon (or NO).



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