NFSDCLD(8)

πŸ“¦
version 3.1.1 Β· 2 versions
, in arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NFSDCLD(8) β€” the nfsdcld bestie handbook πŸ’–

okay so listen, this is the manual page for nfsdcld(8), aka the NFSv4 Client Tracking Daemon, and bestie it's giving "quietly holding the whole server together" energy and I am obsessed. 🫢


✨ NAME ✨

nfsdcld β€” the NFSv4 Client Tracking Daemon. that's it, that's the name, she's straightforward and she ate. πŸ’…


🌸 SYNOPSIS 🌸

nfsdcld [-d] [-F] [-p path] [-s stable storage dir]

look at her, four little flags, no drama. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so nfsdcld is the NFSv4 client tracking daemon. and like, real talk β€” you do not need to run this on machines that aren't acting as NFSv4 servers. if your box isn't an NFSv4 server, this is not your moment, and that's okay, we respect it. πŸ™ˆ

here's the drama it prevents, and ngl it's kind of a horror story: when a network partition happens combined with a server reboot, there are edge conditions that can cause the server to grant lock reclaims when other clients have taken conflicting locks in the interim. yes, that's as messy as it sounds. 😭 if you want the full deep dive, it's described in RFC 3530, section 8.6.3 β€” go read it, I'll wait.

to stop all that from happening, the server has to track a small amount of per-client information on stable storage. and this daemon right here? she's the userspace piece of that whole functionality. main character energy, truly. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -d, --debug β€” turns on debug level logging. she gets chatty. πŸ—£οΈ
  • -F, --foreground β€” runs the daemon in the foreground and prints all output to stderr. no hiding, we're being transparent about it. ✨
  • *-p *path, --pipefsdir=path β€” where the rpc_pipefs filesystem lives. the default value is /var/lib/nfs/rpc_pipefs.
  • *-s *storage_dir, --storagedir=storage_dir β€” the directory where stable storage information should be kept. the default value is /var/lib/nfs/nfsdcld.

πŸŽ€ CONFIGURATION FILE πŸŽ€

these values are recognized in the [nfsdcld] section of the /etc/nfs.conf configuration file:

  • storagedir β€” equivalent to -s/--storagedir. same vibe, different font. πŸ“
  • debug β€” setting "debug = 1" is equivalent to -d/--debug. yep, just like that.

and additionally, this next one is recognized from the [general] section:

  • pipefs-directory β€” equivalent to -p/--pipefsdir. it lives over in general, she's a social butterfly. πŸ¦‹

⭐ NOTES ⭐

okay this part is the lore drop, sit down, hydrate. 🧚

the Linux kernel NFSv4 server has historically tracked this information on stable storage by manipulating information on the filesystem directly, in the directory to which /proc/fs/nfsd/nfsv4recoverydir points. old school. manual. unhinged. πŸ’€

this changed with the original introduction of the nfsdcld upcall in kernel version 3.4, which was later deprecated in favor of the nfsdcltrack(8) usermodehelper program β€” support for that one was added in kernel version 3.8. however β€” and this is the plot twist β€” since the usermodehelper upcall does not work in containers, support for a new version of the nfsdcld upcall was added in kernel version 5.2. we love a comeback arc. πŸ”₯

this daemon requires a kernel that supports the nfsdcld upcall. on older kernels, if the legacy client name tracking code was in use, then the kernel would not create the pipe that nfsdcld uses to talk to the kernel. on newer kernels, nfsd attempts to initialize client tracking in this exact order:

  1. first, the nfsdcld upcall.
  2. second, the nfsdcltrack usermodehelper upcall.
  3. finally, the legacy client tracking.

this daemon should be run as root, because the pipe it uses to communicate with the kernel is only accessible by root. 🫑 and then β€” plot twist again β€” the daemon does drop all superuser capabilities after starting. so because of that, the storagedir should be owned by root, and be readable and writable by owner. write that down. ✍️

the daemon now supports different upcall versions, which lets the kernel pass additional data to be stored in the on-disk database. the kernel will query the supported upcall version from nfsdcld during client tracking initialization.

here's the upgrade/downgrade tea, and it matters:

  • a restart of nfsd is not necessary after upgrading nfsdcld β€” however, nfsd will not use a later upcall version until restart.
  • a restart of nfsd is necessary after downgrading nfsdcld, to ensure that nfsd does not use an upcall version that nfsdcld does not support.
🚨 and additionally: a downgrade of nfsdcld requires the schema of the on-disk database to be downgraded as well. that can be accomplished using the nfsdclddb(8) utility. do not skip this step bestie, I'm begging. 😭

🌈 FILES 🌈

  • /var/lib/nfs/nfsdcld/main.sqlite

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

the nfsdcld daemon was developed by Jeff Layton <jlayton@redhat.com> with modifications from Scott Mayhew <smayhew@redhat.com>. legends, both of them, no cap. 🫢


and that's the whole page, babe β€” this version is dated 2011-12-21 and it comes to you from the NFSDCLD(8) manual, so if you ever need to cite your sources, you know exactly where she lives. go forth and track those clients. πŸ’–βœ¨

πŸ“¦ where this page comes from