Linux OS service ‘portmap’

Service Name

portmap

Description

Portmap service maps RPC requests to the correct services. RPC processes notify portmap when they start, revealing the port number they are monitoring and the RPC program numbers they expect to serve. The client system then contacts portmap service on the server with a particular RPC program number. portmap then redirects the client to the proper port number to communicate with its intended service.

This service executes portmap daemon and portmap service must be started before any RPC servers are invoked. Portmap is needed for the programs which use SUN RPC. NFS and NIS are the typical service to need this portmap. This service is provided by portmap rpm package, which should be installed on any machine which acts as a server for protocols using RPC.

Service Control

Use the chkconfig utility to configure (enable and disable) the portmap service i.e.:

# chkconfig --list portmap
portmap         0:off   1:off   2:on    3:on    4:on    5:on    6:off

Use the service command to manage (stop, start, etc.) the portmap service interactively ie.:

# service  portmap
Usage: /etc/init.d/portmap {start|stop|status|restart|reload|condrestart}

To start the service :

# service portmap start
Starting portmap:                                           [  OK  ]

To stop the service :

# service portmap stop
Stopping portmap:                                           [  OK  ]

To check the status of the service :

# service portmap status
portmap (pid 8951) is running...

To restart the service :

# service portmap restart
Stopping portmap:                                           [  OK  ]
Starting portmap:                                           [  OK  ]

Conditionally restarting the service :

# service portmap condrestart
Stopping portmap:                                           [  OK  ]
Starting portmap:                                           [  OK  ]

To reload the service :

# service portmap reload
Reloading configuration:                                   [  OK  ]

Configuration

There is no configuration file for this service. The following options may be added by portmap daemon:
-d: prevents portmap from running as a daemon, and causes errors and debugging information to be printed to the standard error output.
-l: causes portmap to only bind to the loopback interface (i.e. INADDR_LOOPBACK).
-v: run portmap in verbose mode.

The rpcinfo tool, can be used to find all the RPC services registered on a specified host and to report their universal addresses and the transports for which they are registered. Following example shows all of the RPC services registered on the local machine :

# rpcinfo -p localhost
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp    980  status
    100024    1   tcp    983  status
Related Post