RPCNFSDARGS missing from /etc/default/nfs-kernel-server

Bug #1898778 reported by Patrick Goetz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

The tl;dr: version:

An RPCNFSARGS variable needs to be added to /etc/default/nfs-kernel-server file in order to facilitate turning off NFSv3, so that the rpcbind dependency goes away. Otherwise the user is forced to snoop through all the related systemd service files (as I did) in order to figure out how to turn off NFSv3. Meanwhile, this does appear in /etc/default/nfs-kernel-server, but doesn't seem to be used anywhere in the systemd service file chain for nfsd:

  # Runtime priority of server (see nice(1))
  RPCNFSDPRIORITY=0

I'll just repost what I wrote to the NFS developers list about this:

The service file for the nfs server, /usr/lib/systemd/system/nfs-config.service

includes this:

  Wants=nfs-config.service
  After=nfs-config.service

All nfs-config does is run this script:

  ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh

and the script reads the /etc/default/nfs* files and then

  echo RPCNFSDARGS=\"$RPCNFSDOPTS ${RPCNFSDCOUNT:-8}\"

which then goes on the command line in the nfs-server service file:

  ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS

So the solution is to add this line to /etc/default/nfs-kernel-server:

  RPCNFSDOPTS="-N 2 -N 3"

Still unaccounted for is this variable in /etc/default/nfs-kernel-server:

  # Runtime priority of server (see nice(1))
  RPCNFSDPRIORITY=0

Which I can't find used anywhere in the service files. But in any case, adding the RPCNFSDOPTS variable resolved the issue:

root@helios:~# cat /proc/fs/nfsd/versions
-2 -3 +4 +4.1 +4.2

Tags: fr-875
Patrick Goetz (pgoetz)
description: updated
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Patrick,
thank you for your report!

#1 RPCNFSDPRIORITY
That was used with the old style of starting a service like
  start-stop-daemon ... --nicelevel $RPCNFSDPRIORITY
in sysV style nfs-kernel-server.init
Which doesn't work that way in systemd, one would need to set the following in the service file
  LimitNICE=$RPCNFSDPRIORITY

#2 RPCNFSDOPTS
I agree to your analysis of /usr/lib/systemd/scripts/nfs-utils_env.sh generating /run/sysconfig/nfs-utils on behalf of nfs-config.service.
And then nfs-server.service using this ans environment for $RPCNFSDARGS
Of echo RPCNFSDARGS=\"$RPCNFSDOPTS ${RPCNFSDCOUNT:-8}\" we have:
- RPCNFSDCOUNT which is in the .default
- RPCNFSDOPTS missing in .default
- the .default lists some exclusions, but this isn't part of that list

# the following are supported by the systemd units, but not exposed in default files
# echo SMNOTIFYARGS=\"$SMNOTIFYARGS\"
# echo RPCIDMAPDARGS=\"$RPCIDMAPDARGS\"
# echo RPCGSSDARGS=\"$RPCGSSDARGS\"
# echo BLKMAPDARGS=\"$BLKMAPDARGS\"
# echo GSS_USE_PROXY=\"$GSS_USE_PROXY\"

Note: the old sysV also didn't have RPCNFSDOPTS/RPCNFSDARGS it directly passed RPCNFSDCOUNT.
So this isn't a regression but a request to fix a feature (daemon arguments) that seems only partially implemented.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

@Patrick - you said "... NFS developers list ...".
I guess that will be:
- https://marc.info/?l=linux-nfs&m=160104525207592&w=2
- https://marc.info/?l=linux-nfs&m=160194005820117&w=2
If there is more that is worth to link please post it on the bug.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I tried to check if other Distributions silently implemented this without pushing/discussing upstream but e.g. on Fedora this has in /usr/lib/systemd/system/nfs-server.service just:

ExecStart=/usr/sbin/rpc.nfsd

And no EnvironmentFile statement at all.

But that doesn't mean there is no arguments at all, they are just on 2.x already which switched
to /etc/nfs.conf which contains e.g. NFS version control.

See:
http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=2662e1ba98707014b6167e1e5bd3162d6d8f52af

I guess the triage of this bug takes me deeper into NFS land than I ever was.
Please I beg your pardon if I make mis-assumptions ... :-)

Initial assessment, until we can move to 2.x which has /etc/nfs.conf replacing all of this we should fix both issues.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

After confirming the issue and checking some of the code/background.

The .default file is part of the Debian packaging and there is no e.g. example file provided by upstream source to copy from. So it seems to me packaging and upstream got out of sync on this.
- RPCNFSDPRIORITY was always Debian/Ubuntu only but the .service is from upstream
- RPCNFSDOPTS/RPCNFSDARG was added by upstream on the .service, but never got into debian/nfs-kernel-server.default

A fix might IMHO look like:
https://git.launchpad.net/~paelzer/ubuntu/+source/nfs-utils/commit/?id=9266408ab22b88aa00aabd565733afe3799f81b9
https://git.launchpad.net/~paelzer/ubuntu/+source/nfs-utils/commit/?id=837c9b38b347994df7cab4ef482596abce4d5428
https://git.launchpad.net/~paelzer/ubuntu/+source/nfs-utils/commit/?id=07babeb94f8830de550c3147346023e872e406d6

As pushed to https://code.launchpad.net/~paelzer/ubuntu/+source/nfs-utils/+git/nfs-utils/+ref/lp-1898778-opt-parsing

But as I said this isn't my home turf, I need to discuss this with some people and the Debian maintainers. I mean from my naive POV why not go for 2.x but OTOH that might have massive complexities and implications ...

Changed in nfs-utils (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
tags: added: server-triage-discuss
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

@Foundations-Team
I don't yet know why this was in my inbox today :-) But I hope this initial triage run helps to consider this bug accordingly.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Dan Streetman (ddstreet) wrote :

And there is bug 1878601; nfs-utils really does need to get upgraded.

tags: removed: server-triage-discuss
tags: added: rls-hh-incoming
tags: added: fr-875
removed: rls-hh-incoming
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.