Upon execution, inetd reads its configuration information from a configuration pathnames on the command line, by default, /etc/inetd.conf and /etc/initd.d. If the configuration pathname is a directory, all the files in the directory are read like a configuration file. All of the configuration files are read and merged. There must be an entry for each field in the configuration file, with entries for each field separated by a tab or a space. Comments are denoted by a “#” at the beginning of a line. There must be an entry for each field. The fields of the configuration file are summarized in the table below (optional parts are enclosed in square brackets:
Optional ‘service node’ prefix is allowed for internet services. When present, it supplies the local addresses inetd should use when listening for that service. ‘Service node’ consists of a comma-separated list of addresses. Both symbolic host names and numeric IP addresses are allowed. Symbolic hostnames are looked up in DNS service. If a hostname has multiple address mappings, inetd creates a socket to listen on each address.
To avoid repeating an address that occurs frequently, a line with a host address specifier and colon, but no further fields is allowed, e.g.:
127.0.0.1,192.168.0.5:
The address specifier from such a line is remembered and used for all further lines lacking an explicit host specifier. Such a default address remains in effect until another such line or end of the configuration is encountered, whichever occurs first.
A special hostname ‘*’ stands for INADDR_ANY
. When used
in a normal configuration line, it causes the default address
specifier to be ignored for that line. When used in a default address
specification, e.g.:
*:
it causes any previous default address specifier to be forgotten.
Servers using stream sockets generally are multi-threaded and use the ‘nowait’ entry. Connection requests for these services are accepted by inetd, and the server is given only the newly-accepted socket connected to a client of the service. Most stream-based services and all TCPMUX services operate in this manner. For such services, the number of running instances of the server can be limitied by specifying optional ‘max’ suffix (a decimal number), e.g.: ‘nowait.15’.
Stream-based servers that use ‘wait’ are started with the
listening service socket, and must accept at least one connection
request before exiting. Such a server would normally accept and
process incoming connection requests until a timeout. services must
use ‘nowait’.
It is common usage to specify /usr/sbin/tcpd in this field.
argv[0]
, which is the name of the program. If
the service is provided internally, this entry must contain the word
‘internal’, or be empty.