"inetd" is one of the networking daemons (Internet super-server as quoted by the man page) started up ("fork"ed and "exec"ed) when the "init" process reads the "inittab" file and "net9"'s action field is "respawn". The inetd program waits for some process to connect to one of the "servers" that the inet daemon supports (found in /etc/servers). Only when the connection request comes in does inetd fire up ("fork" and "exec") the associated server process. It then continues listening for other connection requests (distinguished by the unique combination of the protocol type, Internet address, and port number).
In other words, "inetd" doesn't fire up all the "servers" listed in the /etc/servers file just because the "service" is listed in the file. There must be a connection request for that service before it is invoked. At this point, let's clear up possible confusion between "/etc/servers" and "/etc/services".
The servers file contains the servers ("services") that our A/UX Internet daemon supports. Additionally, "inetd" calls "getservent," which reads "/etc/services" for more information such as port number, etc. This file references all the known services on the DARPA Internet. A simple analogy: "/etc/services" is the dictionary and "/etc/servers" are the words in your vocabulary.
You could theoretically run "inetd" in background mode and it would act the same as being spawned from the "inittab" file -- EXCEPT for one crucial thing. If the daemon quits for some reason, it would not be automatically reinvoked ("respawned") as it does when it is read from the inittab file with the "respawn" action (see inittab(4) for more information on "respawn").
Why are some network services handled by init reading "/etc/inittab" and others invoked by "inetd"? The network services listed in "/etc/inittab" are:
- portmap
- ypserv
- ypbind
- nfsd
- biod
- in.routed
- in.rwhod
- named
Each of these programs must be running all the time in a network environment for reasons like caching, performance, and availability for completion of a network requests. These "services" can't be called to life when a connection request comes in and then dropped when the connection request has completed, because these programs maintain the network and must be around at all times. Therefore, we must fire them up during the creation of the networking environment.
Services that do a task, then quit, are the services listed in the /etc/servers file.
Article Change History:
23 Aug 1994 - Reviewed and updated.
Support Information Services