Page MenuHomeFreeBSD

D26938.id78728.diff
No OneTemporary

D26938.id78728.diff

Index: etc/defaults/rc.conf
===================================================================
--- etc/defaults/rc.conf
+++ etc/defaults/rc.conf
@@ -376,6 +376,7 @@
keyserv_enable="NO" # Run the SecureRPC keyserver (or NO).
keyserv_flags="" # Flags to keyserv (if enabled).
nfsv4_server_enable="NO" # Enable support for NFSv4
+nfsv4_server_only="NO" # Set NFS server to NFSv4 only
nfscbd_enable="NO" # NFSv4 client side callback daemon
nfscbd_flags="" # Flags for nfscbd
nfsuserd_enable="NO" # NFSv4 user/group name mapping daemon
Index: etc/rc.d/mountd
===================================================================
--- etc/rc.d/mountd
+++ etc/rc.d/mountd
@@ -20,13 +20,28 @@
mountd_precmd()
{
- force_depend rpcbind || return 1
+ rc_flags="${mountd_flags}"
+ # Load the modules now, so that the vfs.nfsd sysctl
+ # oids are available.
+ load_kld nfsd
+
+ # Do not force rpcbind to be running for an NFSv4 only server.
+ #
+ if checkyesno nfsv4_server_only; then
+ echo 'NFSv4 only server'
+ sysctl vfs.nfsd.server_min_nfsvers=4 > /dev/null
+ sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
+ rc_flags="${rc_flags} -R"
+ else
+ force_depend rpcbind || return 1
+ fi
+
# mountd flags will differ depending on rc.conf settings
#
if checkyesno nfs_server_enable ; then
if checkyesno weak_mountd_authentication; then
- rc_flags="${mountd_flags} -n"
+ rc_flags="${rc_flags} -n"
fi
else
if checkyesno mountd_enable; then
Index: etc/rc.d/nfsd
===================================================================
--- etc/rc.d/nfsd
+++ etc/rc.d/nfsd
@@ -41,12 +41,15 @@
if checkyesno nfsv4_server_enable; then
sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
- else
+ elif ! checkyesno nfsv4_server_only; then
echo 'NFSv4 is disabled'
sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null
fi
- force_depend rpcbind || return 1
+ if ! checkyesno nfsv4_server_only; then
+ force_depend rpcbind || return 1
+ fi
+
force_depend mountd || return 1
if [ -n "${nfs_server_vhost}" ]; then
command_args="-V \"${nfs_server_vhost}\""

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 1:41 PM (6 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14717482
Default Alt Text
D26938.id78728.diff (2 KB)

Event Timeline