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
Unknown Object (File)
Sat, Aug 9, 2:11 PM
Unknown Object (File)
Sat, Aug 9, 6:30 AM
Unknown Object (File)
Sat, Aug 9, 2:48 AM
Unknown Object (File)
Fri, Aug 1, 4:31 PM
Unknown Object (File)
Mon, Jul 28, 10:52 PM
Unknown Object (File)
Mon, Jul 28, 7:41 PM
Unknown Object (File)
Mon, Jul 28, 5:07 PM
Unknown Object (File)
Mon, Jul 28, 4:22 PM
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 64599
Build 61483: 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.

851

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