This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.sbin / inetd / inetd.8
CommitLineData
15637ed4
RG
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.\"
b41acc45 32.\" from: @(#)inetd.8 6.7 (Berkeley) 3/16/91
159f9a1c 33.\" $Id: inetd.8,v 1.2 1993/09/23 17:31:37 jtc Exp $
15637ed4
RG
34.\"
35.Dd March 16, 1991
36.Dt INETD 8
37.Os BSD 4.3
38.Sh NAME
39.Nm inetd
40.Nd internet
41.Dq super-server
42.Sh SYNOPSIS
43.Nm inetd
44.Op Fl d
159f9a1c 45.Op Fl l
15637ed4
RG
46.Op Ar configuration file
47.Sh DESCRIPTION
48.Nm Inetd
49should be run at boot time by
50.Pa /etc/rc.local
51(see
52.Xr rc 8 ) .
53It then listens for connections on certain
54internet sockets. When a connection is found on one
55of its sockets, it decides what service the socket
56corresponds to, and invokes a program to service the request.
57After the program is
58finished, it continues to listen on the socket (except in some cases which
59will be described below). Essentially,
60.Nm inetd
61allows running one daemon to invoke several others,
62reducing load on the system.
63.Pp
64The option available for
65.Nm inetd:
66.Bl -tag -width Ds
67.It Fl d
68Turns on debugging.
159f9a1c
RG
69.It Fl l
70Turns on logging.
15637ed4
RG
71.El
72.Pp
73Upon execution,
74.Nm inetd
75reads its configuration information from a configuration
76file which, by default, is
77.Pa /etc/inetd.conf .
78There must be an entry for each field of the configuration
79file, with entries for each field separated by a tab or
80a space. Comments are denoted by a ``#'' at the beginning
81of a line. There must be an entry for each field. The
82fields of the configuration file are as follows:
83.Pp
84.Bd -unfilled -offset indent -compact
85service name
86socket type
87protocol
88wait/nowait
89user
90server program
91server program arguments
92.Ed
93.Pp
b41acc45
C
94To specify an
95.Em Sun-RPC
96based service, the entry would contain these fields.
97.Pp
98.Bd -unfilled -offset indent -compact
99service name/version
100socket type
101rpc/protocol
102wait/nowait
103user
104server program
105server program arguments
106.Ed
107.Pp
15637ed4
RG
108The
109.Em service-name
110entry is the name of a valid service in
111the file
112.Pa /etc/services .
113For
114.Dq internal
115services (discussed below), the service
116name
117.Em must
118be the official name of the service (that is, the first entry in
b41acc45
C
119.Pa /etc/services ) .
120When used to specify a
121.Em Sun-RPC
122based service, this field is a valid RPC service name in
123the file
124.Pa /etc/rpc .
125The part on the right of the
126.Dq /
127is the RPC version number. This
128can simply be a single numeric argument or a range of versions.
129A range is bounded by the low version to the high version -
130.Dq rusers/1-3 .
131
15637ed4
RG
132.Pp
133The
134.Em socket-type
135should be one of
136.Dq stream ,
137.Dq dgram ,
138.Dq raw ,
139.Dq rdm ,
140or
141.Dq seqpacket ,
142depending on whether the socket is a stream, datagram, raw,
143reliably delivered message, or sequenced packet socket.
144.Pp
145The
146.Em protocol
147must be a valid protocol as given in
148.Pa /etc/protocols .
149Examples might be
150.Dq tcp
151or
152.Dq udp .
b41acc45
C
153Rpc based services are specified with the
154.Dq rpc/tcp
155or
156.Dq rpc/udp
157service type.
158
15637ed4
RG
159.Pp
160The
161.Em wait/nowait
162entry is applicable to datagram sockets only (other sockets should
163have a
164.Dq nowait
165entry in this space). If a datagram server connects
166to its peer, freeing the socket so
167.Nm inetd
168can received further messages on the socket, it is said to be
169a
170.Dq multi-threaded
171server, and should use the
172.Dq nowait
173entry. For datagram servers which process all incoming datagrams
174on a socket and eventually time out, the server is said to be
175.Dq single-threaded
176and should use a
177.Dq wait
178entry.
179.Xr Comsat 8
180.Pq Xr biff 1
181and
182.Xr talkd 8
183are both examples of the latter type of
184datagram server.
185.Xr Tftpd 8
186is an exception; it is a datagram server that establishes pseudo-connections.
187It must be listed as
188.Dq wait
189in order to avoid a race;
190the server reads the first packet, creates a new socket,
191and then forks and exits to allow
192.Nm inetd
193to check for new service requests to spawn new servers.
194.Pp
195The
196.Em user
197entry should contain the user name of the user as whom the server
198should run. This allows for servers to be given less permission
199than root.
200.Pp
201The
202.Em server-program
203entry should contain the pathname of the program which is to be
204executed by
205.Nm inetd
206when a request is found on its socket. If
207.Nm inetd
208provides this service internally, this entry should
209be
210.Dq internal .
211.Pp
212The
213.Em server program arguments
214should be just as arguments
215normally are, starting with argv[0], which is the name of
216the program. If the service is provided internally, the
217word
218.Dq internal
219should take the place of this entry.
220.Pp
221.Nm Inetd
222provides several
223.Dq trivial
224services internally by use of
225routines within itself. These services are
226.Dq echo ,
227.Dq discard ,
228.Dq chargen
229(character generator),
230.Dq daytime
231(human readable time), and
232.Dq time
233(machine readable time,
234in the form of the number of seconds since midnight, January
2351, 1900). All of these services are tcp based. For
236details of these services, consult the appropriate
237.Tn RFC
238from the Network Information Center.
239.Pp
159f9a1c
RG
240When given the
241.Fl l
242option
243.Nm Inetd
244will log an entry to syslog each time an
245.Xr accept 2
246is made, which notes the
247service selected and the IP-number of the remote requestor.
248.Pp
15637ed4
RG
249.Nm Inetd
250rereads its configuration file when it receives a hangup signal,
251.Dv SIGHUP .
252Services may be added, deleted or modified when the configuration file
253is reread.
254.Sh SEE ALSO
255.Xr comsat 8 ,
256.Xr fingerd 8 ,
257.Xr ftpd 8 ,
258.Xr rexecd 8 ,
259.Xr rlogind 8 ,
260.Xr rshd 8 ,
261.Xr telnetd 8 ,
262.Xr tftpd 8
263.Sh HISTORY
264The
265.Nm
266command appeared in
267.Bx 4.3 .
b41acc45
C
268Support for
269.Em Sun-RPC
270based services is modelled after that
271provided by
272.Em Sun-OS 4.1 .