aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc/rc.d/mountd
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-03-09 00:08:02 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-03-09 00:08:02 +0000
commit09673fc0f36dd1cca74940a240a9ed0f62228084 (patch)
tree6f38298f5721e8c454727716c3d8084bdaf1df18 /libexec/rc/rc.d/mountd
parent075e4807df3e6b0d9196d56e4dbc33765d57e1f8 (diff)
downloadsrc-09673fc0f36dd1cca74940a240a9ed0f62228084.tar.gz
src-09673fc0f36dd1cca74940a240a9ed0f62228084.zip
mountd(8): generate a syslog message when the "V4:" line is missing
Daniel reported that NFSv4 mounts were not working despite having set "nfsv4_server_enable=YES" in /etc/rc.conf. Mountd was logging a message that there was no /etc/exports file. He noted that creating a /etc/exports file with a "V4:" line in it was needed make NFSv4 mounts work. At least one "V4:" line in one of the exports(5) file(s) is needed to make NFSv4 mounts work. This patch fixes mountd.c so that it logs a message indicting that there is no "V4:" line in any exports(5) file when NFSv4 mounts are enabled. To avoid this message being generated erroneously, /etc/rc.d/mountd is updated to make sure vfs.nfsd.server_max_nfsvers is properly set before mountd(8) is started. Reported by: debdrup PR: 253901 MFC after: 2 weeks
Diffstat (limited to 'libexec/rc/rc.d/mountd')
-rwxr-xr-xlibexec/rc/rc.d/mountd3
1 files changed, 3 insertions, 0 deletions
diff --git a/libexec/rc/rc.d/mountd b/libexec/rc/rc.d/mountd
index 85d04c37a018..ba573ad732cc 100755
--- a/libexec/rc/rc.d/mountd
+++ b/libexec/rc/rc.d/mountd
@@ -34,6 +34,9 @@ mountd_precmd()
rc_flags="${rc_flags} -R"
else
force_depend rpcbind || return 1
+ if ! checkyesno nfsv4_server_enable; then
+ sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null
+ fi
fi
# mountd flags will differ depending on rc.conf settings