NFSv4 in debian without portmap & co.

J. Bruce Fields bfields at fieldses.org
Wed Mar 26 12:35:48 EDT 2008


On Wed, Mar 26, 2008 at 03:17:44AM +0100, Anders Andersson wrote:
> Hi! I'm trying to set up a simple NFSv4-only server here, and I
> dislike running daemons that I don't need, so I'm trying to trim it
> down a little. After some googling I found this document,
> http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/ch-nfs.html
> that tells me: "NFSv4 has no interaction with portmapper, rpc.mountd,
> rpc.lockd, and rpc.statd". Even more explicitly in the description of
> portmap:
> 
> "portmap — The RPC service for Linux; it responds to requests for RPC
> services and sets up connections to the requested RPC service. This is
> not used with NFSv4."
> 
> So, I want to get rid of the portmapper. I run debian stable on my
> server, so I simply stop the portmap service, make sure that it's
> gone, and try to start the nfsd with this command, just for testing:
> "rpc.nfsd -N2 -N3 8".
> 
> However, this will just freeze for a minute or so, then return without
> starting up any kernel threads. I'm using the debian stable default
> kernel which is a 2.6.18. Is this behaviour expected, and is there any
> way to work around it, preferably without recompiling the kernel?

I believe what happens is the server (in
net/sunrpc/rpcb_clnt.c:rpcb_register) is doing an upcall to register
itself with the portmapper.  The minute is probably the time it takes
for it to give up.  So to fix this we'd need to ignore the result of
that rpc call, and make it asynchronous.

I don't think we'd want that behavior unconditionally, since if you
actually are depending on portmap, you probably do want nfsd startup to
fail if portmap registration fails.  So we'd have to decide when to
enable the new behavior.  (Automatically when only nfsv4 is started?  Or
make this a separate configuration?)

> Debian will normally try to start the daemon with just "rpc.nfsd 8",
> but I added the -N2 and -N3 to see if I could get rid of the freeze if
> it didn't need to do any v2 or v3 code.

For now I'd just start mountd with -i 127.0.0.1, and at least it won't
be listening on any real interface.  In Debian you can set this up by
editing /etc/default/portmap.

--b.


More information about the NFSv4 mailing list