xref: /original-bsd/usr.sbin/inetd/inetd.8 (revision 56c13d2e)
1.\" Copyright (c) 1985, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)inetd.8	6.7 (Berkeley) 03/16/91
7.\"
8.Dd
9.Dt INETD 8
10.Os BSD 4.3
11.Sh NAME
12.Nm inetd
13.Nd internet
14.Dq super-server
15.Sh SYNOPSIS
16.Nm inetd
17.Op Fl d
18.Op Ar configuration file
19.Sh DESCRIPTION
20.Nm Inetd
21should be run at boot time by
22.Pa /etc/rc.local
23(see
24.Xr rc 8 ) .
25It then listens for connections on certain
26internet sockets.  When a connection is found on one
27of its sockets, it decides what service the socket
28corresponds to, and invokes a program to service the request.
29After the program is
30finished, it continues to listen on the socket (except in some cases which
31will be described below).  Essentially,
32.Nm inetd
33allows running one daemon to invoke several others,
34reducing load on the system.
35.Pp
36The option available for
37.Nm inetd:
38.Bl -tag -width Ds
39.It Fl d
40Turns on debugging.
41.El
42.Pp
43Upon execution,
44.Nm inetd
45reads its configuration information from a configuration
46file which, by default, is
47.Pa /etc/inetd.conf .
48There must be an entry for each field of the configuration
49file, with entries for each field separated by a tab or
50a space.  Comments are denoted by a ``#'' at the beginning
51of a line.  There must be an entry for each field.  The
52fields of the configuration file are as follows:
53.Pp
54.Bd -unfilled -offset indent -compact
55service name
56socket type
57protocol
58wait/nowait
59user
60server program
61server program arguments
62.Ed
63.Pp
64The
65.Em service-name
66entry is the name of a valid service in
67the file
68.Pa /etc/services .
69For
70.Dq internal
71services (discussed below), the service
72name
73.Em must
74be the official name of the service (that is, the first entry in
75.Pa /etc/services ) .
76.Pp
77The
78.Em socket-type
79should be one of
80.Dq stream ,
81.Dq dgram ,
82.Dq raw ,
83.Dq rdm ,
84or
85.Dq seqpacket ,
86depending on whether the socket is a stream, datagram, raw,
87reliably delivered message, or sequenced packet socket.
88.Pp
89The
90.Em protocol
91must be a valid protocol as given in
92.Pa /etc/protocols .
93Examples might be
94.Dq tcp
95or
96.Dq udp .
97.Pp
98The
99.Em wait/nowait
100entry is applicable to datagram sockets only (other sockets should
101have a
102.Dq nowait
103entry in this space).  If a datagram server connects
104to its peer, freeing the socket so
105.Nm inetd
106can received further messages on the socket, it is said to be
107a
108.Dq multi-threaded
109server, and should use the
110.Dq nowait
111entry.  For datagram servers which process all incoming datagrams
112on a socket and eventually time out, the server is said to be
113.Dq single-threaded
114and should use a
115.Dq wait
116entry.
117.Xr Comsat 8
118.Pq Xr biff 1
119and
120.Xr talkd 8
121are both examples of the latter type of
122datagram server.
123.Xr Tftpd 8
124is an exception; it is a datagram server that establishes pseudo-connections.
125It must be listed as
126.Dq wait
127in order to avoid a race;
128the server reads the first packet, creates a new socket,
129and then forks and exits to allow
130.Nm inetd
131to check for new service requests to spawn new servers.
132.Pp
133The
134.Em user
135entry should contain the user name of the user as whom the server
136should run.  This allows for servers to be given less permission
137than root.
138.Pp
139The
140.Em server-program
141entry should contain the pathname of the program which is to be
142executed by
143.Nm inetd
144when a request is found on its socket.  If
145.Nm inetd
146provides this service internally, this entry should
147be
148.Dq internal .
149.Pp
150The
151.Em server program arguments
152should be just as arguments
153normally are, starting with argv[0], which is the name of
154the program.  If the service is provided internally, the
155word
156.Dq internal
157should take the place of this entry.
158.Pp
159.Nm Inetd
160provides several
161.Dq trivial
162services internally by use of
163routines within itself.  These services are
164.Dq echo ,
165.Dq discard ,
166.Dq chargen
167(character generator),
168.Dq daytime
169(human readable time), and
170.Dq time
171(machine readable time,
172in the form of the number of seconds since midnight, January
1731, 1900).  All of these services are tcp based.  For
174details of these services, consult the appropriate
175.Tn RFC
176from the Network Information Center.
177.Pp
178.Nm Inetd
179rereads its configuration file when it receives a hangup signal,
180.Dv SIGHUP .
181Services may be added, deleted or modified when the configuration file
182is reread.
183.Sh SEE ALSO
184.Xr comsat 8 ,
185.Xr fingerd 8 ,
186.Xr ftpd 8 ,
187.Xr rexecd 8 ,
188.Xr rlogind 8 ,
189.Xr rshd 8 ,
190.Xr telnetd 8 ,
191.Xr tftpd 8
192.Sh HISTORY
193The
194.Nm
195command appeared in
196.Bx 4.3 .
197