diff options
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r-- | usr.sbin/rpc.lockd/lockd.c | 19 | ||||
-rw-r--r-- | usr.sbin/rpc.lockd/rpc.lockd.8 | 6 |
2 files changed, 14 insertions, 11 deletions
diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index 3b1572e..1e55540 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -46,7 +46,9 @@ __RCSID("$NetBSD: lockd.c,v 1.7 2000/08/12 18:08:44 thorpej Exp $"); * The actual program logic is in the file lock_proc.c */ -#include <sys/types.h> +#include <sys/param.h> +#include <sys/linker.h> +#include <sys/module.h> #include <sys/socket.h> #include <sys/stat.h> @@ -116,7 +118,7 @@ main(int argc, char **argv) int maxrec = RPC_MAXDATASIZE; in_port_t svcport = 0; - while ((ch = getopt(argc, argv, "d:g:h:kp:")) != (-1)) { + while ((ch = getopt(argc, argv, "d:g:h:p:")) != (-1)) { switch (ch) { case 'd': debug_level = atoi(optarg); @@ -153,9 +155,6 @@ main(int argc, char **argv) out_of_mem(); } break; - case 'k': - kernel_lockd = TRUE; - break; case 'p': endptr = NULL; svcport = (in_port_t)strtoul(optarg, &endptr, 10); @@ -175,6 +174,16 @@ main(int argc, char **argv) exit(1); } + kernel_lockd = FALSE; + if (modfind("nfslockd") < 0) { + if (kldload("nfslockd") < 0) { + fprintf(stderr, "Can't find or load kernel support for rpc.lockd - using non-kernel implementation\n"); + } + kernel_lockd = TRUE; + } else { + kernel_lockd = TRUE; + } + (void)rpcb_unset(NLM_PROG, NLM_SM, NULL); (void)rpcb_unset(NLM_PROG, NLM_VERS, NULL); (void)rpcb_unset(NLM_PROG, NLM_VERSX, NULL); diff --git a/usr.sbin/rpc.lockd/rpc.lockd.8 b/usr.sbin/rpc.lockd/rpc.lockd.8 index 9cd429b..4fabe5d 100644 --- a/usr.sbin/rpc.lockd/rpc.lockd.8 +++ b/usr.sbin/rpc.lockd/rpc.lockd.8 @@ -41,7 +41,6 @@ .Nd NFS file locking daemon .Sh SYNOPSIS .Nm -.Op Fl k .Op Fl d Ar debug_level .Op Fl g Ar grace period .Op Fl h Ar bindip @@ -59,11 +58,6 @@ with Options and operands available for .Nm : .Bl -tag -width indent -.It Fl k -The -.Fl k -option specifies the use of the kernel-resident NFS lock manager, if -possible. .It Fl d The .Fl d |