Linux-NFS Archive on
 help / color / Atom feed
From: Donald Brady <>
Subject: nfs-config.service fails to apply no-nfs-version after a reboot
Date: Thu, 11 Jul 2019 14:06:07 -0600
Message-ID: <> (raw)

NFSv4 bug: nfs-config.service fails to apply --no-nfs-version after a reboot

Server kernel version: 4.15.0-1043
Distribution: Ubuntu 18.04.2 LTS
nfs-utils version: 1:1.3.4-2.1ubuntu5.2

There are various configuration options for the nfs server that reside
in '/etc/default/nfs-kernel-server'.  To disable NFS versions 4.1 and
4.2, you can specify:

RPCNFSDOPTS="--no-nfs-version 4.1 --no-nfs-version 4.2"

The nfs-config.service consumes the above RPCNFSDOPTS and creates
RPCNFSDARGS that the nfs-server.service will pass to rpc.nfsd(8) for
its ExecStart (see results below).

$ cat /var/run/sysconfig/nfs-utils
RPCNFSDARGS="--no-nfs-version 4.1 --no-nfs-version 4.2 64"

In turn, rpc.nfsd  parses the version info from RPCNFSDARGS and writes
it as  "-4.1 -4.2 -2 +3 +4" to '/proc/fs/nfsd/versions'

However, after a reboot, the initial state of versions is "-2 -3 -4
-4.0 -4.1 -4.2" (i.e. nothing is yet enabled) so the kernel ignores
the '-4.1' and '-4.2' since it thinks 4 is not enabled.

Note that if rpc.nfsd had written versions as "+3 +4 -4.1 -4.2 -2"
then the attempt to remove 4.1 and 4.2 would have succeed.

As a work-around you can write '+4' to `/proc/fs/nfsd/versions` after
a reboot before the nfs-server.service runs rpc.nfsd


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NFS Archive on

Archives are clonable:
	git clone --mirror linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ \
	public-inbox-index linux-nfs

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox