Network Services

Network services were discussed in Chapter 16. inetd is a network daemon that runs on the system and listens on behalf of many server processes that are not started at boot time. The inetd daemon starts the appropriate server process when a request for that service is received. The /etc/inetd.conf file contains the list of services that inetd is to provide. The following is an entry from the /etc/inetd.conf file:

ftp     stream  tcp6    nowait  root    /usr/sbin/in.ftpd       in.ftpd 

The syntax for the entry is as follows:

<service_name> tli <proto> <flags> <user> <server_pathname> <args> 

Each network service uses a port that represents an address space, which is reserved for that service. Systems communicate with each other through these ports. Well-known ports are listed in the /etc/service file. The following are a few entries from the /etc/services file:

ftp-data        20/tcp 
ftp             21/tcp 
telnet          23/tcp 

From these entries, we can see that the FTP service will communicate via port 21 and use the TCP protocol.

Each network service must have a unique port number that is used by all of the hosts on the network. Keeping track of these ports can be difficult, especially on a network supporting several network services.

Solaris utilizes a client/server model known as a Remote Procedure Call (RPC). When using an RPC service, a client connects to a special server process, rpcbind, which is a well-known registered Internet service. rpcbind registers port numbers associated with each RPC service listed in the /etc/ rpc file. The rpcbind process receives all RPC-based client application connection requests and sends the client the appropriate server port number. For example, mountd, which is described in Chapter 22, “The NFS Environment,” is listed in the /etc/rpc file as follows:

mountd          100005  mount showmount 

The mountd daemon has a program number of 100005 and is also known as mount and showmount.

Use the rpcinfo utility with the –p option to list registered RPC programs running on a system. For example, I can check on processes on another system as follows:

rpcinfo –p 192.168.1.21 

The system responds with a list of all the registered RPC services found running on that system. The listing displays the program number, version, protocol, port, and service name. One of those listed is the mountd service:

program     vers     proto   port    service 
100005      1        udp     32784   mountd 

You can also use rpcinfo to unregister an RPC program. When used with the –d option, you can delete registration for a service. For example, sprayd is running on the local system. I could unregister it as follows:

rpcinfo  -d sprayd 1 

The sprayd service would be stopped. In Chapter 15, “Managing Processes,” I described how to send a signal to a process. I could restart sprayd by sending a HUP (hangup) signal to the inetd daemon, as follows:

pkill –HUP inetd 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset