As we discussed earlier, a system that offers many network services needs many server processes listening on many ports.
This need creates a substantial load on the system. The internet
daemon [1], inetd, provides a mechanism for reducing the number of different listening servers and a
central location for
controlling network services.
To accomplish these goals, the inetd process listens on many ports simultaneously for incoming connections.
When a connection arrives at one of the ports under its control, the inetd process uses the
fork()
and
exec()
system calls to
start specific server process needed to handle a connection at that well-known port.
For example, suppose that inetd is listening to TCP port 23.
When a new connection for port 23 arrives, inetd starts a telnet server process and passes the incoming connection to this new server process.
The inetd process is controlled by its configuration file /etc/inetd.conf. This file tells inetd how to respond to incoming connections on a given port. A typical line in the /etc/inetd.conf file looks like this: