Page MenuHomeFreeBSD

rpcbind: Ensure krpc is present.
ClosedPublic

Authored by des on May 31 2025, 12:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 18, 1:35 PM
Unknown Object (File)
Sun, Aug 17, 2:27 PM
Unknown Object (File)
Wed, Aug 6, 10:50 AM
Unknown Object (File)
Tue, Jul 29, 8:49 AM
Unknown Object (File)
Tue, Jul 29, 8:29 AM
Unknown Object (File)
Tue, Jul 29, 6:48 AM
Unknown Object (File)
Tue, Jul 29, 12:54 AM
Unknown Object (File)
Mon, Jul 28, 1:20 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.May 31 2025, 12:41 PM
glebius added a reviewer: rmacklem.

I added Rick, since the change seems to me orthogonal to changes I did in CURRENT. IMHO, change is correct and is also applicable to stable/14, which doesn't have my changes.

This revision is now accepted and ready to land.Jun 2 2025, 8:35 PM

Are you sure? I didn't think the krpc used rpcbind.

Are you sure? I didn't think the krpc used rpcbind.

It's the other way around; rpcbind isn't useful without krpc, and while krpc usually ends up getting loaded sooner or later, if it's not present when rpcbind starts, you get error messages on the console.

In D50627#1156452, @des wrote:

Are you sure? I didn't think the krpc used rpcbind.

It's the other way around; rpcbind isn't useful without krpc, and while krpc usually ends up getting loaded sooner or later, if it's not present when rpcbind starts, you get error messages on the console.

Not really useful is not really correct. It so happens that, at this time, NFS and related things
are all that is using SunRPC. However, it is easy to write a userspace only RPC apprlication.
(There are the libc library calls and rpcgen, etc.)

Saying it isn't useful without the krpc is kinda like saying "cc" isn't useful without /usr/src.

then either fix rpcbind so it doesn't print an error when started before krpc is loaded, or approve this review... your choice

In D50627#1156884, @des wrote:

then either fix rpcbind so it doesn't print an error when started before krpc is loaded, or approve this review... your choice

Well, since I did not do the commit that broke it, I'm not sure I
should be the one fixing it.

It does appear that the glebius@ patch that adds use of netlink requires krpc.
It is not obvious to me if that means all other uses of netlink require krpc as well now.
--> If the answer is "yes", then the netlink module should get a
MODULE_DEPENDS(netlink, krpc, 1, 1, 1) added.
--> If the answer is no, then rpcbind does need to load the krpc. I'd rather see a
patch that does something like:

        if (modfind("nfsd") < 0) {
		/* Not present in kernel, try loading it */
		if (kldload("nfsd") < 0 || modfind("nfsd") < 0)
			errx(1, "NFS server is not available");

}
so that rpcbind will load it even when started from command line instead
of via the rc scripts.

move kldload into rpcbind

This revision now requires review to proceed.Jun 6 2025, 12:56 PM
This revision is now accepted and ready to land.Jun 6 2025, 1:51 PM

Netlink of course doesn't need krpc, it is the opposite. Autoloading by rpcbind(8) itself seems even better.

This revision was automatically updated to reflect the committed changes.