The systemd service files shipped with nfs-utils load configuration from /etc/conf.d/nfs but refer to different variables in their ExecStart lines. For example in nfs-server.service there is a line
although in /etc/conf.d/nfs the variable is named OPTS_RPC_NFSD.
Please use the following patch to fix the problem. At least until the unit files are fully compliant with https://wiki.gentoo.org/wiki/Project:Systemd/Ebuild_policy#Unit_file_guidelines
Created attachment 399964 [details, diff]
Edit environment variable names to march conf.d/nfs
*** Bug 538780 has been marked as a duplicate of this bug. ***
This is definitely real and the patch is correct. I'm running my nfs server with the updated env variables for several months now.
(In reply to Leho Kraav (:macmaN @lkraav) from comment #3)
> This is definitely real and the patch is correct. I'm running my nfs server
> with the updated env variables for several months now.
Yeah, same things here, variables in /etc/conf.d/nfs are irrelevant to those actually passed to the systemd service file. Also it seems like there are missing one crucial dependency, during nfs-server.service activation rpc_pipefs should be mounted, so I suggest to also add to the nfs-server.service file next lines:
Using /etc/conf.d/nfs is not an option. That's a step backward and violates our policy.
We should instead set a reasonable default for RPCNFSDARGS in a systemd drop-in file.
This won't make /etc/conf.d/nfs relevant on systems with systemd anyway.
Any progress on this ? Maybe use something like this as an drop-in replacement for systemd:
And change the EnvironmentFile=/etc/conf.d/nfs in all nfs-related unit files to EnvironmentFile=/etc/systemd/system/nfs-server.service.d/00gentoo.conf
Sorry i forgot to add '=' in the last 2 Environment= lines.
It seems like nfs-utils-2.3.1-r3 added the possibility to specify certain options for most of the rpc.* daemons in a central (distribution-independent) /etc/nfs.conf file. Here's an excerpt from man rpc.nfsd:
Many of the options that can be set on the command line can also be controlled through values set in the [nfsd] section of the /etc/nfs.conf configuration file. Values recognized include:
The number of threads to start.
host A host name, or comma separated list of host names, that rpc.nfsd will listen on. Use of the --host option replaces all host names listed here.
AFAICS, rpc.gssd, rpc.mountd rpc.svcgssd rpc.idmapd options can all be set in /etc/nfs.conf. Check your manpages !
Tyvm Chris. After 1hr of head-scratching and finally arriving at your message, I was able to migrate my custom port configuration over from `/etc/conf.d/nfs -> /etc/nfs.conf`
leho@gusto /etc $ cat nfs.conf
port = 32767
port = 32765
outgoing-port = 32766