Internet super-server
Syntax:
inetd [-d] [configuration_file]
Options:
- -d
- Turn on debugging.
Description:
The inetd daemon, which is typically started by
/etc/netstart, listens for connections on
certain well-known ports. When it finds a connection on one
of its sockets, the daemon decides what service the socket
corresponds to, and invokes a program to service the
request. After that program is finished, inetd
continues to listen on the socket (except in some cases,
which are described below). Essentially, inetd
lets you run one daemon to invoke several others, reducing
load on the system.
When it starts, inetd reads its configuration
information from a configuration file; by default, this is
/etc/inetd.conf. The file must have an entry
in each of its fields, with each field separated by a tab or
a space. Comments are denoted by a # at the
beginning of a line.
The fields in the configuration file are:
- service name — the name of a valid
service in the file /etc/services. For
“internal” services (discussed below), the
service name must be the official name of the service (i.e.
the first entry in /etc/services).
- socket type — should be one of
stream, dgram, or raw,
depending on whether the socket is a stream, datagram, or
raw socket.
- protocol — must be a valid protocol
given in /etc/protocols. For example,
tcp or udp. For RPC daemons, the
underlying protocol must also be specified, followed by a
/ (e.g rpc/udp).
- wait/nowait — sockets other than
datagram sockets should have a nowait entry in
this space. If a datagram server connects to its peer,
freeing the socket so inetd can receive further
messages on the socket, it's said to be a multi-threaded
server and should use the nowait entry.
If a datagram server processes all incoming datagrams on a
socket and eventually times out, that server is said to be
single-threaded and should use a wait entry. The
tftpd daemon is an exception — it's a
datagram server that establishes pseudo-connections. It must
be listed as wait in order to avoid a race; the
server reads the first packet, creates a new socket, and
then forks and exits to let inetd check for new
service requests to spawn new servers.
- user — should contain the username of
the user that the server will run as. This allows servers to
be given less permission than root.
- server program — should contain the
pathname of the program to be executed by inetd
when a request is found on inetd's socket. If the
desired service is provided internally by inetd
(e.g. see echo below), this field should contain
the word internal.
- server program arguments — should be
specified just as arguments normally are, starting
with argv[0], which is the name of the program.
If the server program field is
internal, you can leave this field blank.
The inetd daemon provides several
“trivial” services internally by using routines
within itself. These services are:
- echo
- (echoes data received)
- discard
- (discards data received)
- chargen
- (generates characters)
- daytime
- (human-readable time)
- time
- (machine-readable time, in the form of the number of
seconds since midnight, January 1, 1970)
All of these services are UDP- or TCP-based.
When it receives SIGHUP, inetd re-reads its
configuration file, which may cause services to be added,
deleted, or modified.
See also:
ftpd,
rexecd,
rlogind,
rshd,
telnetd,
tftpd