NFS problem: portmap won't start properly

Posted on 1998-12-08
Medium Priority
Last Modified: 2012-08-13
Dear Expert.

I'm trying no start the NFS service on a RedHat 5.0 system on a PC where I have root access.
When I start the portmapper as root (/usr/sbin/portmap) it seemingly lives as a process when I check with ps aux, but when I try do anything that has to do with rpc, say /usr/sbin/rpc.mountd or /usr/sbin/rpcinfo -p the portmapper vanishes from the list of running processes and there is an error message like "Cannot register service: RPC: Unable to recieve; errno = Connection refused".
When I check messages in /var/log/messages it sometimes says
"portmap[xxxx]: cannot bind udp: Permission denied". Could this be because portmap is run as user bin when I check it with ps aux, and not as root? I start the portmapper as root and I suppose it should run as bin, or?

Besides, from where should portmap, rpc.mountd and rpc.nfsd be started at boot time in a RedHat system? I've searched a lot of doc's, faq's and man pages for this information, but it never becomes as specific to say exactly where or how. In the file /etc/rc.d/init.d/inet it says that this script starts the Internet Network Deamon & RPC portmapper, but there is no sign of references to /usr/sbin/portmap what so ever. (Not even in a system I have where the portmapper starts correctly from boot time). Could that be added there together with mountd and nfsd or where? I've tried that but it doesn't work.

Long story folks, do you have a good answer?

Question by:andersn
  • 2
  • 2

Expert Comment

ID: 1587813
 5.1.  The RPC Portmapper

To run any of the software mentioned below you will need to run the program /usr/sbin/rpc.portmap. Some Linux distributions already have the code in /etc/rc.d/rc.inet2 to start up this daemon.  All you have to do is uncomment it and reboot your Linux machine to activate it.

The RPC portmapper (portmap(8c)) is a server that converts RPC program numbers into TCP/IP (or UDP/IP) protocol port numbers. It must be running in order to make RPC calls (which is what the NIS client software does) to RPC servers (like a NIS server) on that machine.
When an RPC server is started, it will tell portmap what port number it is listening to, and what RPC program numbers it is prepared to serve.  When a client wishes to make an RPC call to a given program number, it will first contact portmap on the server machine to determine the port number where RPC packets should be sent.

Normally, standard RPC servers are started by inetd(8C), so portmap must be started before inetd is invoked.                              

Author Comment

ID: 1587814
OK, thanks but I knew most of this already. From what document have you extracted this information by the way?
In the Redhat distribution there seems to be no file /etc/rc.d/rc.inet2 so what is it's equivalent in Redhat?


Expert Comment

ID: 1587815
The file that I got this info from was in /usr/doc/HOWTO file NIS-HOWTO.
The equivalent in Redhat is /etc/rc.d/init.d/inet

Accepted Solution

zblaxell earned 800 total points
ID: 1587816
Red Hat starts portmap through /etc/rc.d/init.d/portmap, included in the portmap package.  Starting with Red Hat 5.0 you should be able to type "/sbin/chkconfig --add portmap" and all will be well.  'man chkconfig' documents Red Hat's additional layer of glue code on top of their basic startup script mechanism.

Simply put, startup scripts live in /etc/rc.d/init.d, and are activiated by the presence or absence of a symbolic link to that location in /etc/rc.d/rc3.d.  In /etc/rc.d/rc3.d there are scripts with names like "SXXyyyy", where "XX" is a number from 00 to 99, and "yyyy" is a name like "portmap".  The startup scripts from /etc/inittab execute these scripts in order with the argument "start".  For shutdown there are also scripts named "KXXyyyy" which turn services off.

Portmap should be run as 'root'.  It might change its euid after starting, but it needs root because it needs port 111.

I'd urge you to try the official Red Hat update packages for portmap.  Red Hat didn't manage to get the various pieces of NIS (including portmap) working properly until several updates after Red Hat 5.1.

If this machine has any kind of security issues (e.g. it can be reached from the Internet) you should upgrade all of the network server packages (see updates.redhat.com).  There are exploitable, well-known security holes in all Red Hat versions prior to 5.2, particularly in the DNS name server.  

Author Comment

ID: 1587817
OK, an upgrade of portmap and nfs-server fixed the problem just fine. It still puzzles me though, because if I at installation time of Linux say that I want the NFS-server package installed it works fine. But, if don't add the NFS-server packade until after installation (that is add nfs-server and portmap) it doesn't work. However adding the upgraded versions of portmap and nfs-server works as a post-installation.
In other words, how come the original server package works if installed during installation but not as a post-installation?

Anyway, thanks alot Zblaxell


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

568 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question