Page MenuHomeFreeBSD

nfsd, rpcbind: add -P option to support pidfile path
ClosedPublic

Authored by khng on May 31 2025, 7:31 AM.
Tags
None
Referenced Files
F139373730: D50624.id156433.diff
Thu, Dec 11, 9:57 AM
Unknown Object (File)
Thu, Nov 27, 10:15 AM
Unknown Object (File)
Thu, Nov 27, 12:30 AM
Unknown Object (File)
Sun, Nov 16, 1:53 AM
Unknown Object (File)
Nov 10 2025, 3:25 AM
Unknown Object (File)
Nov 8 2025, 3:46 AM
Unknown Object (File)
Oct 28 2025, 1:01 AM
Unknown Object (File)
Oct 26 2025, 5:12 AM
Subscribers

Details

Summary

The -P option, when specified opens a pidfile to a given path.

Sponsored by: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64567
Build 61451: arc lint + arc unit

Event Timeline

khng requested review of this revision.May 31 2025, 7:31 AM

I'll leave the minor nits up to you.
Are you a committer or do you need me
to do it?

usr.sbin/nfsd/nfsd.c
456

I think I'd call this a LOG_ERR, since the pidfile
wasn't set up correctly.

usr.sbin/rpcbind/rpcbind.c
260

Same as above. Minor nit, but I'd call this
a LOG_ERR.

846

The string argument is in alphabetical order
with upper case before lower case, so I'd put
"P" after "N".
(Again, a minor nit.)

This revision is now accepted and ready to land.Jun 7 2025, 10:26 PM

I'll leave the minor nits up to you.
Are you a committer or do you need me
to do it?

No worries, I am a committer.

By the way, given that rpcbind and nfsd will install a default pidfile to /var/run even without specifying -P: shall we document that somewhere in RELNOTES and the commit message, or do we make the errno == EEXIST case a warn() call instead of errx()? I am thinking of that because some people might spin up multiple nfsd in their setup without using the rc.d/nfsd script, and with different bound IP for each nfsd spun.

By the way, given that rpcbind and nfsd will install a default pidfile to /var/run even without specifying -P: shall we document that somewhere in RELNOTES and the commit message, or do we make the errno == EEXIST case a warn() call instead of errx()? I am thinking of that because some people might spin up multiple nfsd in their setup without using the rc.d/nfsd script, and with different bound IP for each nfsd spun.

If they spin up multiple instances of the nfsd, it will be badly broken.
The only case where a system can run multiple instances of nfsd is
when each of them is in a separate vnet prison.

As such, it should be a fatal error for nfsd, imho.

khng marked 3 inline comments as done.

Addressed.

This revision now requires review to proceed.Jun 9 2025, 3:23 AM
This revision is now accepted and ready to land.Jun 9 2025, 3:39 AM