fix sccsid to use keywords and modern initialization syntax
[unix-history] / usr / src / usr.sbin / inetd / inetd.8
CommitLineData
55270cae
KM
1.\" Copyright (c) 1985 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
f8cbfd03 5.\" @(#)inetd.8 6.4 (Berkeley) %G%
55270cae
KM
6.\"
7.TH INETD 8 ""
8.UC 6
9.SH NAME
10inetd \- internet ``super\-server''
11.SH SYNOPSIS
12.B /etc/inetd
13[
14.B \-d
15] [ configuration file ]
16.SH DESCRIPTION
17.I Inetd
18should be run at boot time by
19.IR /etc/rc.local .
20It then listens for connections on certain
21internet sockets. When a connection is found on one
22of its sockets, it decides what service the socket
23corresponds to, and invokes a program to service the request.
24After the program is
25finished, it continues to listen on the socket (except in some cases which
26will be described below). Essentially,
27.I inetd
28allows running one daemon to invoke several others,
29reducing load on the system.
30.PP
31Upon execution,
32.I inetd
33reads its configuration information from a configuration
34file which, by default, is
35.IR /etc/inetd.conf .
36There must be an entry for each field of the configuration
37file, with entries for each field separated by a tab or
38a space. Comments are denoted by a ``#'' at the beginning
39of a line. There must be an entry for each field. The
40fields of the configuration file are as follows:
41.br
42 service name
43.br
44 socket type
45.br
46 protocol
47.br
48 wait/nowait
49.br
50 user
51.br
52 server program
53.br
54 server program arguments
55.PP
56The
57.I service name
58entry is the name of a valid service in
59the file
60.IR /etc/services/ .
61For ``internal'' services (discussed below), the service
62name
63.I must
63c183b7 64be the official name of the service (that is, the first entry in
55270cae
KM
65.IR /etc/services ).
66.PP
67The
68.I socket type
69should be one of ``stream'', ``dgram'', ``raw'', ``rdm'', or ``seqpacket'',
70depending on whether the socket is a stream, datagram, raw,
71reliably delivered message, or sequenced packet socket.
72.PP
73The
74.I protocol
75must be a valid protocol as given in
76.IR /etc/protocols .
77Examples might be ``tcp'' or ``udp''.
78.PP
79The
80.I wait/nowait
81entry is applicable to datagram sockets only (other sockets should
82have a ``nowait'' entry in this space). If a datagram server connects
83to its peer, freeing the socket so
84.I inetd
85can received further messages on the socket, it is said to be
86a ``multi-threaded'' server, and should use the ``nowait''
87entry. For datagram servers which process all incoming datagrams
88on a socket and eventually time out, the server is said to be
63c183b7 89``single-threaded'' and should use a ``wait'' entry. ``Comsat'' (``biff'')
55270cae
KM
90and ``talk'' are both examples of the latter type of
91datagram server.
63c183b7
MK
92.I Tftpd
93is an exception; it is a datagram server that establishes pseudo-connections.
94It must be listed as ``wait'' in order to avoid a race;
95the server reads the first packet, creates a new socket,
96and then forks and exits to allow
97.I inetd
98to check for new service requests to spawn new servers.
55270cae
KM
99.PP
100The
101.I user
102entry should contain the user name of the user as whom the server
103should run. This allows for servers to be given less permission
104than root.
105The
106.I server program
107entry should contain the pathname of the program which is to be
108executed by
109.I inetd
110when a request is found on its socket. If
111.I inetd
112provides this service internally, this entry should
113be ``internal''.
114.PP
115The arguments to the server program should be just as they
116normally are, starting with argv[0], which is the name of
117the program. If the service is provided internally, the
118word ``internal'' should take the place of this entry.
119.PP
120.I Inetd
121provides several ``trivial'' services internally by use of
122routines within itself. These services are ``echo'',
123``discard'', ``chargen'' (character generator), ``daytime''
124(human readable time), and ``time'' (machine readable time,
125in the form of the number of seconds since midnight, January
1261, 1900). All of these services are tcp based. For
127details of these services, consult the appropriate RFC
128from the Network Information Center.
f8cbfd03
MK
129.PP
130.I Inetd
131rereads its configuration file when it receives a hangup signal, SIGHUP.
132Services may be added, deleted or modified when the configuration file
133is reread.
55270cae
KM
134.SH "SEE ALSO"
135comsat(8C), ftpd(8C), rexecd(8C), rlogind(8C), rshd(8C),
63c183b7 136telnetd(8C), tftpd(8C)