Lesson 10 | Remote Procedure Calls (RPC) |
Objective | Check the status of the portmapper process rpcbind and use the rpcinfo command to determine what RPC services are available. |
Remote Procedure Calls (RPC)
Question: How do I check the status of the portmapper process rpcbind and use the rpcinfo command to determine what RPC services are available? To check the status of the portmapper process rpcbind, you can use the following command:
ps -e | grep rpcbind
This will show you a list of all processes that are running with the name rpcbind. If the process is running, you will see the PID (Process ID) and the command that is being executed. If the process is not running, you will see nothing.
To use the rpcinfo command to determine what RPC services are available, you can use the following command:
rpcinfo -p
This will show you a list of all RPC programs that are registered with the portmapper. Each program will have a program number, a version number, and an IP protocol type (TCP or UDP).
For example, the following output shows that there are two RPC programs registered with the portmapper:
Program number = 100000
Version = 2
Protocol = tcp
Program number = 100001
Version = 2
Protocol = udp
You can use this information to determine which RPC services are available on your system.
UNIX system administrators need to be aware of one other important class of network services, based on Sun Microsystem's (RPC) Remote Procedure Call protocol. The RPC protocol allows processes to make subroutine calls on one machine that are executed by processes on remote machines. RPC is used by many important network services, especially the
Network File System (NFS)[1] and
NIS/NIS+(the Network Information Systems)[2].
Portmapper process
The most important aspect of the RPC protocol that a UNIX system administrator needs to understand is the role of the portmapper process (also called rpcbind). Services available using RPC do not use well-defined port numbers. Instead, a server process using RPC registers itself with a special process that functions as a directory. This process used to be called the portmapper (it mapped RPC requests to port numbers) but now tends to have the less informative name of rpcbind. When a client needs to contact a particular RPC service, it first asks the portmapper process which port it should contact to find the desired service. The portmapper is the only RPC process with a well-known port number (111).
One important consequence of this arrangement is that if for some reason the portmapper process is not running, many important system functions will crash. Error messages that mention “program not registered” usually refer to some problem with the portmapper process, or another RPC-related problem.
Checking the status of the portmapper
checkStatus port Mapper Process using Linux
In these simulations, you will check the status of the portmapper process rpcbind, and use the rpcinfo
command to learn what RPC services are available on your machine. Choose which UNIX version you would like to simulate by clicking either the Linux or the Solaris button.
Check Status of Portmapper Process using Solaris
Here are the steps you needed to follow to successfully complete this simulation:
- You are logged in as root. Issue the command to verify that the rpcbind process is running on your system.
Solution:
ps -ef | grep rpcbind
- You have verified that rpcbind is running. The rpcinfo program is a diagnostic tool that allows you to issue a test RPC call to an RPC server. If the server is running, it will send back a response. The information contained within this response informs you about the ports that have been mapped by rpcbind. Now, issue the command to learn about its status on your own system.
Solution: /usr/sbin/rpcinfo -p localhost
-
You have tested your own system. Let's assume that other UNIX systems running rpc exist on your subnet.
These systems include 192.168.19.63, 192.168.19.64. 192.168.19.93, 192.168.19.95, 192.168.19.98.
Now, use rpcinfo to test the system with the IP address of 192.168.19.63.
Remember: You have not set the PATH for this command, so remember to specify the location of the program
(/usr/sbin/).
Solution:
/usr/sbin/rpcinfo -p 192.168.19.63
[1]NFS: Network File System (NFS) is a Unix-based file system that allows remote access to shared disk resources.
[2]Network Information Service (NIS): NIS is Sun Microsystems's Yellow Pages (yp) client-server protocol for distributing system configuration data such as user and host names between computers on a network.