git: 5919cf3218d9 - stable/13 - mountd startup: enable NFSv4 if needed on restart
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Jul 2022 12:45:25 UTC
The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=5919cf3218d988239d14564ba16160d323eda3d4 commit 5919cf3218d988239d14564ba16160d323eda3d4 Author: Mike Karels <karels@FreeBSD.org> AuthorDate: 2022-07-03 23:04:41 +0000 Commit: Mike Karels <karels@FreeBSD.org> CommitDate: 2022-07-11 12:43:58 +0000 mountd startup: enable NFSv4 if needed on restart The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly when it is run at system startup, relying on the kernel default. However, if NFSv4 was enabled in /etc/rc.conf later, and the script was re-run to restart mountd, the sysctl was still set to 3. Set the sysctl to the right value in all cases. Reviewed by: rmacklem (cherry picked from commit 1cf8e6339e9add47107a6c9988a0f509225b7ef6) --- libexec/rc/rc.d/mountd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/mountd b/libexec/rc/rc.d/mountd index 0c6e75f07d64..d75416736245 100755 --- a/libexec/rc/rc.d/mountd +++ b/libexec/rc/rc.d/mountd @@ -34,7 +34,9 @@ mountd_precmd() rc_flags="${rc_flags} -R" else force_depend rpcbind || return 1 - if ! checkyesno nfsv4_server_enable; then + if checkyesno nfsv4_server_enable; then + sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null + else sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null fi fi