386BSD 0.1 development
[unix-history] / usr / src / usr.sbin / inetd / inetd.8
CommitLineData
b24337d5
WJ
1.\" Copyright (c) 1985, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)inetd.8 6.7 (Berkeley) 3/16/91
33.\"
34.Dd March 16, 1991
35.Dt INETD 8
36.Os BSD 4.3
37.Sh NAME
38.Nm inetd
39.Nd internet
40.Dq super-server
41.Sh SYNOPSIS
42.Nm inetd
43.Op Fl d
44.Op Ar configuration file
45.Sh DESCRIPTION
46.Nm Inetd
47should be run at boot time by
48.Pa /etc/rc.local
49(see
50.Xr rc 8 ) .
51It then listens for connections on certain
52internet sockets. When a connection is found on one
53of its sockets, it decides what service the socket
54corresponds to, and invokes a program to service the request.
55After the program is
56finished, it continues to listen on the socket (except in some cases which
57will be described below). Essentially,
58.Nm inetd
59allows running one daemon to invoke several others,
60reducing load on the system.
61.Pp
62The option available for
63.Nm inetd:
64.Bl -tag -width Ds
65.It Fl d
66Turns on debugging.
67.El
68.Pp
69Upon execution,
70.Nm inetd
71reads its configuration information from a configuration
72file which, by default, is
73.Pa /etc/inetd.conf .
74There must be an entry for each field of the configuration
75file, with entries for each field separated by a tab or
76a space. Comments are denoted by a ``#'' at the beginning
77of a line. There must be an entry for each field. The
78fields of the configuration file are as follows:
79.Pp
80.Bd -unfilled -offset indent -compact
81service name
82socket type
83protocol
84wait/nowait
85user
86server program
87server program arguments
88.Ed
89.Pp
90The
91.Em service-name
92entry is the name of a valid service in
93the file
94.Pa /etc/services .
95For
96.Dq internal
97services (discussed below), the service
98name
99.Em must
100be the official name of the service (that is, the first entry in
101.Pa /etc/services ) .
102.Pp
103The
104.Em socket-type
105should be one of
106.Dq stream ,
107.Dq dgram ,
108.Dq raw ,
109.Dq rdm ,
110or
111.Dq seqpacket ,
112depending on whether the socket is a stream, datagram, raw,
113reliably delivered message, or sequenced packet socket.
114.Pp
115The
116.Em protocol
117must be a valid protocol as given in
118.Pa /etc/protocols .
119Examples might be
120.Dq tcp
121or
122.Dq udp .
123.Pp
124The
125.Em wait/nowait
126entry is applicable to datagram sockets only (other sockets should
127have a
128.Dq nowait
129entry in this space). If a datagram server connects
130to its peer, freeing the socket so
131.Nm inetd
132can received further messages on the socket, it is said to be
133a
134.Dq multi-threaded
135server, and should use the
136.Dq nowait
137entry. For datagram servers which process all incoming datagrams
138on a socket and eventually time out, the server is said to be
139.Dq single-threaded
140and should use a
141.Dq wait
142entry.
143.Xr Comsat 8
144.Pq Xr biff 1
145and
146.Xr talkd 8
147are both examples of the latter type of
148datagram server.
149.Xr Tftpd 8
150is an exception; it is a datagram server that establishes pseudo-connections.
151It must be listed as
152.Dq wait
153in order to avoid a race;
154the server reads the first packet, creates a new socket,
155and then forks and exits to allow
156.Nm inetd
157to check for new service requests to spawn new servers.
158.Pp
159The
160.Em user
161entry should contain the user name of the user as whom the server
162should run. This allows for servers to be given less permission
163than root.
164.Pp
165The
166.Em server-program
167entry should contain the pathname of the program which is to be
168executed by
169.Nm inetd
170when a request is found on its socket. If
171.Nm inetd
172provides this service internally, this entry should
173be
174.Dq internal .
175.Pp
176The
177.Em server program arguments
178should be just as arguments
179normally are, starting with argv[0], which is the name of
180the program. If the service is provided internally, the
181word
182.Dq internal
183should take the place of this entry.
184.Pp
185.Nm Inetd
186provides several
187.Dq trivial
188services internally by use of
189routines within itself. These services are
190.Dq echo ,
191.Dq discard ,
192.Dq chargen
193(character generator),
194.Dq daytime
195(human readable time), and
196.Dq time
197(machine readable time,
198in the form of the number of seconds since midnight, January
1991, 1900). All of these services are tcp based. For
200details of these services, consult the appropriate
201.Tn RFC
202from the Network Information Center.
203.Pp
204.Nm Inetd
205rereads its configuration file when it receives a hangup signal,
206.Dv SIGHUP .
207Services may be added, deleted or modified when the configuration file
208is reread.
209.Sh SEE ALSO
210.Xr comsat 8 ,
211.Xr fingerd 8 ,
212.Xr ftpd 8 ,
213.Xr rexecd 8 ,
214.Xr rlogind 8 ,
215.Xr rshd 8 ,
216.Xr telnetd 8 ,
217.Xr tftpd 8
218.Sh HISTORY
219The
220.Nm
221command appeared in
222.Bx 4.3 .