Skip to contentSkip to conversation

NFS port use.

DISCUSSION Simon Kelley 2 participants 3 messages Oct 20, 2005 – Oct 21, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I'm trying to track down a problem with low ports being used by NFS and I've hit a brick wall. I don't think the problem lies in the NFS system, but the solution might, if I can understand what's going on.

Background.

I have a daemon starting at boot time which must bind tcp port 988 or bad things happen. Sometimes it fails with "address in use". By the time that the boot sequence is finished port 988 is free again.

I replaced the daemon with a wrapper like this:

#!/bin/sh
netstat -ap | grep 988 | logger
exec daemon.orig $*

And captured the following:

logger: tcp 0 0 bc-4-3-09.internal.:988 ecs2:sunrpc
TIME_WAIT -

So NFS is implicated. Sure enough, the host is mounting many NFS filesystems on boot, including six or seven from an NFS server called ecs2.

BUT: this is kernel version 2.6.8, without the patch referenced by
http://sourceforge.net/mailarchive/forum.php?thread_id=7704466&forum_id=4930
so, unless I'm mistaken, it should be using ports in the range 1-800, and leaving 988 alone.

I verified that net/sunrpc/xprt.c contains
#define XPRT_MAX_RESVPORT (800)

At this point I need help: my reasoning is wrong somewhere and I can't get any furher. Can anybody clarify things and tell me how to keep the NFS client subsystem away from port 988?

Cheers,

Simon.

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw

to den 20.10.2005 klokka 17:35 (+0100) skreiv Simon Kelley:

Quoted 2 lines

logger: tcp 0 0 bc-4-3-09.internal.:988 ecs2:sunrpc
TIME_WAIT -

This is probably the "mount" program probing the portmapper for the supported NFS versions.

Quoted 3 lines

At this point I need help: my reasoning is wrong somewhere and I can't get any furher. Can anybody clarify things and tell me how to keep the NFS client subsystem away from port 988?

Why can't you just ensure that start your daemon before you start NFS?

Cheers,
Trond

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#2 lore raw
Quoted 9 lines · Trond Myklebust

to den 20.10.2005 klokka 17:35 (+0100) skreiv Simon Kelley:

Quoted 2 lines

logger: tcp 0 0 bc-4-3-09.internal.:988 ecs2:sunrpc
TIME_WAIT -

This is probably the "mount" program probing the portmapper for the supported NFS versions.

That looks likely: I checked the source, and it uses bindresvport(). It looks like that can pick any port < 1024.

Quoted 6 lines
Quoted 3 lines

At this point I need help: my reasoning is wrong somewhere and I can't get any furher. Can anybody clarify things and tell me how to keep the NFS client subsystem away from port 988?

Why can't you just ensure that start your daemon before you start NFS?

Possibly, but the dependencies are rather complex: it would be a case of "create a new start up order with daemon after NFS", not just "move daemon before NFS."

Thanks for you help.

Cheers,

Simon

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs