Page MenuHomeFreeBSD

D26938.diff
No OneTemporary

D26938.diff

Index: head/libexec/rc/rc.conf
===================================================================
--- head/libexec/rc/rc.conf
+++ head/libexec/rc/rc.conf
@@ -380,6 +380,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: head/libexec/rc/rc.d/mountd
===================================================================
--- head/libexec/rc/rc.d/mountd
+++ head/libexec/rc/rc.d/mountd
@@ -20,13 +20,33 @@
mountd_precmd()
{
- force_depend rpcbind || return 1
+ # Load the modules now, so that the vfs.nfsd sysctl
+ # oids are available.
+ load_kld nfsd || return 1
+
+ # 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 nfs_server_enable || checkyesno nfsv4_server_only; then
if checkyesno weak_mountd_authentication; then
- rc_flags="${mountd_flags} -n"
+ if checkyesno nfsv4_server_only; then
+ echo -n 'weak_mountd_authentication '
+ echo -n 'incompatible with nfsv4_server_only, '
+ echo 'ignored'
+ else
+ rc_flags="${rc_flags} -n"
+ fi
fi
else
if checkyesno mountd_enable; then
Index: head/libexec/rc/rc.d/nfsd
===================================================================
--- head/libexec/rc/rc.d/nfsd
+++ head/libexec/rc/rc.d/nfsd
@@ -26,7 +26,7 @@
# Load the modules now, so that the vfs.nfsd sysctl
# oids are available.
- load_kld nfsd
+ load_kld nfsd || return 1
if checkyesno nfs_reserved_port_only; then
echo 'NFS on reserved port only=YES'
@@ -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:05 PM (6 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14716980
Default Alt Text
D26938.diff (2 KB)

Event Timeline