Skip to content

Conversation

@clementnuss
Copy link
Contributor

This extension brings in rpcbind and rpc.statd (from the nfs-utils tools), two daemons required to mount NFS shares with locking support.

using this extension makes it directly possible to use e.g. trident v25.06 to mount NFS shares with locks support. (NetApp/trident#806 (comment))

it would also solve the following issues: siderolabs/talos#6582 siderolabs/talos#8862

I set the TIER of the extension to contrib, but feel free to bump to extra if you think you want to help support the build process.

I could happily contribute some test cases, but I would require some guidance on where to implement those.

@github-project-automation github-project-automation bot moved this to To Do in Planning Oct 27, 2025
@talos-bot talos-bot moved this from To Do to In Review in Planning Oct 27, 2025
- |
mkdir -p /rootfs
mkdir -p /rootfs/usr/local/include/sys
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an extra change? (it is already done in prepare: phase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the prepare: the folder that's created is /usr/local/include/sys, without the /rootfs prefix.
I however need the header file to be in the output of libtirpc to be able to reuse it.

maskedPaths: []
readonlyPaths: []
mounts:
# netconfig file required by libtirpc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these files doesn't need to be on the host, let's just put it into the container rootfs and stop using the mounts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, I had not fully grasped the directory structure for extensions.

@smira smira self-assigned this Oct 28, 2025
@clementnuss
Copy link
Contributor Author

clementnuss commented Oct 30, 2025

after some testing with https://gist.github.com/clementnuss/f292c0b190a987c111ac151232d565fc, I can confirm that the extension does it's job (as described in rpc-statd manual)

  • when a process acquires a lock, rpc.statd is notified and creates a file in /var/lib/nfs/statd/sm/nas.company.tld
  • if you then gracelessly reset the node, without giving it any time to release the lock, the file remains locked until the node boots again
  • at this moment, when the rpc.statd process starts, it execs sm-notify which reads entries in /var/lib/nfs/statd/sm, moves those to /var/lib/nfs/statd/sm.bak, and notifies all entries in the sm.bak folder.
  • the NFS server is notified of a reboot, and releases all locks asociated with that node.
  • at this moment, the lock should be released
❯ talosctl logs ext-rpc-statd
e1-k8slabt-002.company.tld: rpc.statd: Version 2.8.4 starting
e1-k8slabt-002.company.tld: rpc.statd: Flags: No-Daemon Log-STDERR TI-RPC
e1-k8slabt-002.company.tld: sm-notify: Version 2.8.4 starting
e1-k8slabt-002.company.tld: sm-notify: Retired record for mon_name nas.company.tld
e1-k8slabt-002.company.tld: sm-notify: Added host nas.company.tld to notify list
e1-k8slabt-002.company.tld: sm-notify: Running as root.  chown /var/lib/nfs/statd to choose different user
e1-k8slabt-002.company.tld: sm-notify: Sending PMAP_GETPORT for 100024, 1, udp
e1-k8slabt-002.company.tld: sm-notify: Added host nas.company.tld to notify list
e1-k8slabt-002.company.tld: sm-notify: Host nas.company.tld due in 2 seconds
e1-k8slabt-002.company.tld: sm-notify: Received packet...
e1-k8slabt-002.company.tld: sm-notify: Received PMAP_GETPORT result: 4046
e1-k8slabt-002.company.tld: sm-notify: Processing rpcbind reply for nas.company.tld (port 4046)
e1-k8slabt-002.company.tld: sm-notify: Added host nas.company.tld to notify list
e1-k8slabt-002.company.tld: sm-notify: Sending SM_NOTIFY for e1-k8slabt-002
e1-k8slabt-002.company.tld: sm-notify: Added host nas.company.tld to notify list
e1-k8slabt-002.company.tld: sm-notify: Host nas.company.tld due in 2 seconds
e1-k8slabt-002.company.tld: sm-notify: Received packet...
e1-k8slabt-002.company.tld: sm-notify: Host nas.company.tld notified successfully
e1-k8slabt-002.company.tld: sm-notify: Removing nas.company.tld (172.16.248.56, e1-k8slabt-002) from notify list
e1-k8slabt-002.company.tld: rpc.statd: Running as root.  chown /var/lib/nfs/statd to choose different user

Copy link
Contributor Author

@clementnuss clementnuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've addressed your comments, fixed a musl incompatibility, commented the patches and updated the author to PostFinance

for my part, this PR is ready. shall I squash my commits?

maskedPaths: []
readonlyPaths: []
mounts:
# netconfig file required by libtirpc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, I had not fully grasped the directory structure for extensions.

- |
mkdir -p /rootfs
mkdir -p /rootfs/usr/local/include/sys
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the prepare: the folder that's created is /usr/local/include/sys, without the /rootfs prefix.
I however need the header file to be in the output of libtirpc to be able to reuse it.

contains rpc.statd, needed to support locking with NFSv3 shares

Signed-off-by: Andrey Smirnov <[email protected]>
Signed-off-by: Clément Nussbaumer <[email protected]>
Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, I tested this locally, and also Talos integration tests should pick it up so that it runs/starts

@github-project-automation github-project-automation bot moved this from In Review to Approved in Planning Nov 4, 2025
@smira
Copy link
Member

smira commented Nov 4, 2025

/m

@talos-bot talos-bot merged commit db43866 into siderolabs:main Nov 4, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in Planning Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants