Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cannot get lockd to start (was "Cannot get mountd to start")



I changed that to

        nfs_server_flags="-tun 4"

(removed the '6') and it works just fine now.

Well, almost fine.  Mounts are working, but lockd won't start

        # /etc/rc.d/nfslocking start
        Starting statd.
        Starting lockd.
        rpc.lockd: cannot get udp netconf.
        #

It seems that rpc.lockd insists on running under IPv6 if the kernel supports it, whether or not tcp6 and udp6 are present in /etc/netconfig

The attached patch adds a -4 option to make rpc.lockd run only in IPv4 mode, even if IPv6 is available in the kernel. (It also adds a -6 option, which is the default.)

Any reason why this should not be committed?




-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------
Index: lockd.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/rpc.lockd/lockd.c,v
retrieving revision 1.10
diff -u -p -r1.10 lockd.c
--- lockd.c     15 Dec 2007 19:44:56 -0000      1.10
+++ lockd.c     12 Aug 2012 00:41:59 -0000
@@ -84,14 +84,15 @@ int
 main(int argc, char **argv)
 {
        SVCXPRT *transp;
-       int ch, i, maxindex, s;
+       int ch, i, maxindex, s, proto;
        struct sigaction sigchild, sigalarm;
        int grace_period = 30;
        struct netconfig *nconf;
        int maxrec = RPC_MAXDATASIZE;
 
        (void)setprogname(*argv);
-       while ((ch = getopt(argc, argv, "d:g:")) != (-1)) {
+       proto = 4;
+       while ((ch = getopt(argc, argv, "d:g:46")) != (-1)) {
                switch (ch) {
                case 'd':
                        debug_level = atoi(optarg);
@@ -107,6 +108,10 @@ main(int argc, char **argv)
                                /* NOTREACHED */
                        }
                        break;
+               case '4':
+               case '6':
+                       proto = ch - '2';
+                       break;
                default:
                case '?':
                        usage();
@@ -120,14 +125,18 @@ main(int argc, char **argv)
        (void)rpcb_unset(NLM_PROG, NLM_VERS4, NULL);
 
        /*
-        * Check if IPv6 support is present.
+        * Check if IPv6 support is present and wanted.
         */
-       s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
-       if (s < 0)
+       if (proto == 2)
                maxindex = 2;
        else {
-               (void)close(s);
-               maxindex = 4;
+               s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+               if (s < 0)
+                       maxindex = 2;
+               else {
+                       (void)close(s);
+                       maxindex = 4;
+               }
        }
 
        (void)rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
Index: rpc.lockd.8
===================================================================
RCS file: /cvsroot/src/usr.sbin/rpc.lockd/rpc.lockd.8,v
retrieving revision 1.6
diff -u -p -r1.6 rpc.lockd.8
--- rpc.lockd.8 2 Feb 2002 01:42:45 -0000       1.6
+++ rpc.lockd.8 12 Aug 2012 00:41:59 -0000
@@ -32,7 +32,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd September 24, 1995
+.Dd August 11, 2012
 .Dt RPC.LOCKD 8
 .Os
 .Sh NAME
@@ -42,6 +42,8 @@
 .Nm
 .Op Fl d Ar debug_level
 .Op Fl g Ar grace period
+.Op Fl 4
+.Op Fl 6
 .Sh DESCRIPTION
 The
 .Nm
@@ -71,6 +73,14 @@ option allow to specify the grace period
 .Nm
 only accepts requests from hosts which are reinitialising locks which
 existed before the server restart. Default is 30 seconds.
+.It Fl 4
+.It Fl 6
+Specify whether
+.Nm
+should register for both IPv4 and IPv6 clients, or only for IPv4 clients.
+By default,
+.Nm
+will register for both IPv4 and IPv6 if IPv6 support is available.
 .El
 .Pp
 Error conditions are logged to syslog, irrespective of the debug level,


Home | Main Index | Thread Index | Old Index