Inetd - Setup

Setup

The file /etc/services is used to map port numbers and protocols to service names, and the file /etc/inetd.conf is used to map service names to server names. For example, if a TCP request comes in on port 23, /etc/services shows

telnet 23/tcp

The corresponding line in the /etc/inetd.conf file (in this case, taken from a machine running AIX version 5.1) is

telnet stream tcp6 nowait root /usr/sbin/telnetd telnetd -a

This tells inetd to launch the program /usr/sbin/telnetd with the command line arguments telnetd -a. inetd automatically hooks the socket to stdin, stdout, and stderr of the server program.

Generally TCP sockets are handled by spawning a separate server to handle each connection concurrently. UDP sockets are generally handled by a single server instance that handles all packets on that port.

Some simple services, such as echo, are handled directly by inetd, without spawning an external server.

Read more about this topic:  Inetd