Network services are started in two ways: at startup by a boot script or on-demand. Chapter 1, "The Boot Process," discusses scripts and tools that are used to control which services are started at boot time. Listing 1.6 shows the large number of boot scripts used to start services, many of which are easily identified by name as starting network services.
Despite the large number of services started by the boot scripts, many network services are started on-demand by inetd, or alternatively by xinetd. Network services that are started at boot time continue to run, whether or not they are needed, but inetd and xinetd start services only when they are actually needed.
Each startup technique has its own advantages. Starting services on-demand saves the resources that are used when an unneeded service is left running. On the other hand, starting a daemon at boot time saves the overhead associated with repeated startups for a service that is in constant demand.
Depending on which one your system uses, either inetd or xinetd is started at boot time, and continues to run in the background as long as the system is running. The daemon listens to the network ports and starts the appropriate service when data arrive on the port associated with the service. In the same way that getty detects traffic on a serial port and starts login to handle a terminal connection, inetd and xinetd detect traffic on the network, and start the proper service to handle that traffic. (Don't remember getty or login? See Chapter 2.) To understand this process, you need to understand a little about TCP/IP ports.
Was this article helpful?