On Tue, Jun 10, 2025 at 12:11:18PM +0300, Konstantin Belousov wrote:
K> Apparently we already have the feature called 'warmstart', where rpcbind
K> can be restarted and existing registrations are reloaded.  So it is in
K> fact already solved, assuming admin is careful enough to use -w.

Ok, then all that needs to be done is revert this:

--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -159,10 +159,6 @@ main(int argc, char *argv[])
 
        update_bound_sa();
 
-       /* Ensure krpc is loaded */
-       if (modfind("krpc") < 0 && kldload("krpc") < 0)
-               err(1, "krpc");
-
        /* Check that another rpcbind isn't already running. */
        if ((rpcbindlockfd = open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)) < 0)
                err(1, "%s", RPCBINDDLOCK);

Without these lines, rpcbind will log:

Jun 10 08:34:23 bobrik rpcbind[885]: netlink: could not create service

And continue with /var/run/rpcbind.sock set up and ready to service
requests from applications.

We can add an extra message for verbosity:

@@ -223,7 +219,10 @@ main(int argc, char *argv[])
        }
        endnetconfig(nc_handle);
 
-       init_transport(&netlink_nconf);
+       if (init_transport(&netlink_nconf) != 0) {
+               syslog(LOG_ERR, "krpc(4) module missing? "
+                   "Continuing without netlink/krpc transport");
+       }
 
        /*
         * Allocate pipe fd to wake main thread from signal handler in non-racy

I really don't have a strong opinion on what would be right here.  I have no
idea on how wide is the use of rpcbind w/o NFS.  Kostik, Rick and Dag-Erling,
may you together come to agreement on what is right here?

-- 
Gleb Smirnoff

Reply via email to