Distributed Networks Distributed Networks

Network Administration   «Prev  Next»
Lesson 9 Inetd: the super server
Objective Describe how server processes start and stop under the control of inetd.

Server Processes start and stop under the Control of inetd

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, 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 the 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:

Daemon: On UNIX systems, a process which runs independently of any login session and performs system maintenance or functions as a server.
service type protocol wait-status uid 
   server arguments

Here are some sample lines from /etc/inetd.conf, taken from a Linux machine:
inted Linux Information
typical line etcInetdConf
Click the View MouseOver links located above to examine some sample lines from /etc/inetd.conf
The first line of this file means that if an incoming connection arrives on the FTP port, then inetd should run the command:

/usr/sbin/tcpd in.ftpd -l –a

This line will handle a TCP connection (stream TCP) and root will own the resulting process. Furthermore, inetd will not wait for this process to finish before listening again on the FTP port, so FTP is treated concurrently.
The program /usr/sbin/tcpd is a front end for network services. It provides additional levels of access control and logging. It will start the in.ftpd daemon process, which is the real FTP server process. We will not discuss tcpd in this course; it could be eliminated (at some cost in security) by modifying the inetd.conf line to read:
ftp stream tcp nowait 
root /usr/sbin/in.ftpd –l –a
Using inetd
inetd Daemon Vital Component unix System
Server Processes inetd using Solaris
In these simulations, you will explore how server processes start and stop under the control of inetd. Choose which UNIX version you would like to simulate by clicking either the Linux or the Solaris button.
iterative Concurrent Servers - Quiz
Click the Quiz link below to take a short multiple-choice quiz on server processes and iterative/concurrent servers.
iterative Concurrent Servers - Quiz