Solved

NFS problem: portmap won't start properly

Posted on 1998-12-08
5
460 Views
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?

/Anders
0
Comment
Question by:andersn
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:bryanjones
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.                              
0
 

Author Comment

by:andersn
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?

/Anders
0
 
LVL 1

Expert Comment

by:bryanjones
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
0
 
LVL 1

Accepted Solution

by:
zblaxell earned 200 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.  
0
 

Author Comment

by:andersn
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

/Anders
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now