Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 935724

Summary: net-fs/nfs-utils: CONFIG_NFSD_LEGACY_CLIENT_TRACKING is deprecated and nfsdcld has no OpenRC support
Product: Gentoo Linux Reporter: Christopher Byrne <salah.coronya>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: CONFIRMED ---    
Severity: normal CC: daniel, dmoulding, florian-evers, forza, holger, johannes.hirte, mkj, mmk, orzel, pmw.gover, rbezut, s7mon, salah.coronya
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: nfsdcld.initd
nfsdcld.initd

Description Christopher Byrne 2024-07-07 23:43:58 UTC
As of linux kernel 6.8, NFSD client tracking is deprecated, users should move to nfsdcld (part of net-fs/nfs-utils).

If the NFS server is started from an OpenRC server and CONFIG_NFSD_LEGACY_CLIENT_TRACKINGisn't enabled, the following message will
appear in the syslog:

NFSD: Unable to initialize client recovery tracking! (-110)

See https://forums.gentoo.org/viewtopic-t-1169837.html
Comment 1 Thomas Capricelli 2024-08-06 22:03:21 UTC
On linux 6.10.3, i got the following messages.

[   30.739668] NFSD: Unable to initialize client recovery tracking! (-110)
[   30.739678] NFSD: Is nfsdcld running? If not, enable CONFIG_NFSD_LEGACY_CLIENT_TRACKING.
[   30.739682] NFSD: starting 90-second grace period (net f0000000)

And indeed, i couldn't find any information about nfsdcld/gentoo, online or on /etc/conf.d or similar.
Comment 2 Forza 2024-08-06 22:18:00 UTC
The badic nfsdcld init script provided at https://forums.gentoo.org/viewtopic-t-1169837.html works well. It has to be started befire nfsd for it to work properly. It can be seen in dmesg when the nfsdcld is used:

[ 3749.461058] NFSD: Using nfsdcld client tracking operations.
[ 3749.461065] NFSD: no clients to reclaim, skipping NFSv4 grace period (net f0000000)

If nfscld is not started it looks like this:

[   61.930600] NFSD: Unable to initialize client recovery tracking! (-110)
[   61.930605] NFSD: Is nfsdcld running? If not, enable CONFIG_NFSD_LEGACY_CLIENT_TRACKING.
[   61.930607] NFSD: starting 90-second grace period (net f0000000)

I guess we should update the nfs init.d script to depend on nfsdcld. Do we need to check that we have a >=6.8 kernel or that  CONFIG_NFSD_LEGACY_CLIENT_TRACKING is unset? What happens if we run nfsdcld on older kernels?
Comment 3 Christopher Byrne 2024-08-06 22:29:48 UTC
nfsdcld can be used unconditionally. Eventually, it will be required, but its still preferred even when its optional. Support was added in 3.8 and the new upcall mechanism was added in 5.2. Since the oldest kernel supported in Gentoo is 5.10, there should be no issue,
Comment 4 Johannes Hirte 2024-09-07 11:39:51 UTC
Even with a running nfsdcld I get this warning. Just starting the daemon doesn't seem to be enough
Comment 5 Forza 2024-09-28 11:12:38 UTC
(In reply to Johannes Hirte from comment #4)
> Even with a running nfsdcld I get this warning. Just starting the daemon
> doesn't seem to be enough

Did you make sure it was started before nfsd.ko module was loaded?
Comment 6 Holger Hoffstätte 2024-10-21 12:06:45 UTC
I wanted to test this, so:

- added the minimal rc script from the forum post as /etc/init.d/nfsdcld
- added nfsdcld to /etc/conf.d/nfs:NFS_NEEDED_SERVICES

and on reboot of my NFS server (with connected clients) now get:

[  +0.504600] NFSD: Using nfsdcld client tracking operations.
[  +0.000006] NFSD: starting 90-second grace period (net f0000000)
[  +1.383451] NFSD: all clients done reclaiming, ending NFSv4 grace period (net f0000000)

Looks good to me.
Comment 7 Paul Gover 2024-10-31 18:32:14 UTC
I came across this thread while trying to eliminate net-dns/bind as it doesn't appear to be necessary for my NFSV4-only system.

The minimal /etc/init/d/nfsdcld didn't work for me until I added a few lines, resulting in:
-------------
#!/sbin/openrc-run
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

name="nfsdcld"
description="NFSv4 Client Tracking Daemon"
command="/usr/sbin/nfsdcld"

pidfile="/run/nfsdcld.pid"
error_logger="logger"
output_logger="logger"  # Comment out usually, but useful for debugging
command_background="true"
-------------
Not sure if the pidfile is needed, and/or whether it need to run as root.

FWIW, getting rid of net-dns/bind required changes to /etc/conf.d/nfs.
I've started a forum topic about it:
https://forums.gentoo.org/viewtopic-t-1171535.html
Comment 8 Forza 2024-12-18 23:04:56 UTC
Hm..

I have the following init.d/nfs-cld, which works well for me.

-----
name="nfsdcld"
description="NFSv4 Client Tracking Daemon"
command=/usr/sbin/nfsdcld
depend() {
    before nfs
-----

I also have in conf.d/nfs the following:

-----
NFS_NEEDED_SERVICES="rpc.idmapd"
rc_need="nfs-cld"
-----

I guess i could have used NFS_NEEDED_SERVICES instead of rc_need, as init.d/nfs translates it anyways: "need rpc.statd ${myneed} ${NFS_NEEDED_SERVICES}"

We may want to consider implementing the additional options supported[*] by nfsdcld: --pipefsdir, --storagedir and --debug.

* https://www.man7.org/linux//man-pages/man8/nfsdcld.8.html
Comment 9 Forza 2025-02-01 12:33:21 UTC
Created attachment 918018 [details]
nfsdcld.initd

nfsdcld requires nfsd.ko and rpc.pipefs to start.

Also add nfsdcld to conf.d/nfs:
NFS_NEEDED_SERVICES="nfsdcld rpc.idmapd"
Comment 10 Forza 2025-02-01 18:34:16 UTC
Created attachment 918022 [details]
nfsdcld.initd

Replaced the custom mkdir_nfsdirs() with checkpath.
Comment 11 Martin Jørgensen 2025-03-14 10:48:46 UTC
Why not just make it part of the current /etc/init.d/nfs script and start/stop it the same way it starts mountd, etc.?


nfsdcld=/usr/sbin/nfsdcld
...
	start_it nfsdcld ${nfsdcld} ${OPTS_RPC_NFSDCLD}
...
	ebegin "Stopping NFS nfsdcld"
	start-stop-daemon --stop --exec ${nfsdcld}
	eend $?
	ret=$((ret + $?))
...