source: trunk/third/inetd/inetd.8 @ 12141

Revision 12141, 9.9 KB checked in by danw, 26 years ago (diff)
Add paragraph break before description of switched/unswitched.
Line 
1.\"     $NetBSD: inetd.8,v 1.12.2.1 1997/11/11 14:05:35 mrg Exp $
2.\"
3.\" Copyright (c) 1985, 1991 The Regents of the University of California.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"     This product includes software developed by the University of
17.\"     California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     from: @(#)inetd.8       8.4 (Berkeley) 6/1/94
35.\"
36.TH INETD 8 March 16, 1991
37.UC 4
38.SH NAME
39inetd, inetd.conf \- internet ``super-server''
40.SH SYNOPSIS
41.B inetd
42[
43.B \-d
44] [
45.B \-l
46] [
47.B \-n
48] [ configuration file ]
49.SH DESCRIPTION
50.I inetd
51should be run at boot time
52It then listens for connections on certain
53internet sockets.  When a connection is found on one
54of its sockets, it decides what service the socket
55corresponds to, and invokes a program to service the request.
56After the program is
57finished, it continues to listen on the socket (except in some cases which
58will be described below).  Essentially,
59.I inetd
60allows running one daemon to invoke several others,
61reducing load on the system.
62.PP
63The options available for
64.I inetd:
65.PP
66.RS
67.IP \-d
68Turns on debugging.
69.PP
70.IP \-l
71Turns on libwrap connection logging.
72.PP
73.IP \-n
74Turns on ``switched'' services by default.
75.RE
76.PP
77Upon execution,
78.I inetd
79reads its configuration information from a configuration
80file which, by default, is
81.IR /etc/inetd.conf .
82There must be an entry for each field of the configuration
83file, with entries for each field separated by a tab or
84a space.  Comments are denoted by a ``#'' at the beginning
85of a line.  There must be an entry for each field (except for one
86special case, described below).  The
87fields of the configuration file are as follows:
88.PP
89.RS
90service name
91.br
92socket type
93.br
94protocol
95.br
96wait/nowait[.max]
97.br
98switched/unswitched
99.br
100user[.group]
101.br
102server program
103.br
104server program arguments
105.RE
106.PP
107To specify a
108.I Sun-RPC
109based service, the entry would contain these fields.
110.PP
111.RS
112service name/version
113.br
114socket type
115.br
116rpc/protocol
117.br
118wait/nowait[.max]
119.br
120switched/unswitched
121.br
122user[.group]
123.br
124server program
125.br
126server program arguments
127.RE
128.PP
129For Internet services, the first field of the line may also have a host
130address specifier prefixed to it, separated from the service name by a
131colon.  If this is done, the string before the colon in the first field
132indiciates what local address
133.I inetd
134should use when listening for that service, or the single character
135``*''
136to indicate
137INADDR_ANY,
138meaning
139all local addresses.
140To avoid repeating an address that occurs frequently, a line with a
141host address specifier and colon, but no further fields, causes the
142host address specifier to be remembered and used for all further lines
143with no explicit host specifier (until another such line or the end of
144the file).  A line
145.PP
146*:
147.PP
148is implicitly provided at the top of the file; thus, traditional
149configuration files (which have no host address specifiers) will be
150interpreted in the traditional manner, with all services listened for
151on all local addresses.
152.PP
153The
154.I service-name
155entry is the name of a valid service in
156the file
157.IR /etc/services .
158For
159``internal''
160services (discussed below), the service
161name
162.I must
163be the official name of the service (that is, the first entry in
164.IR /etc/services ) .
165When used to specify a
166.I Sun-RPC
167based service, this field is a valid RPC service name in
168the file
169.IR /etc/rpc .
170The part on the right of the
171``/''
172is the RPC version number. This
173can simply be a single numeric argument or a range of versions.
174A range is bounded by the low version to the high version \-
175``rusers/1-3''.
176.PP
177The
178.I socket-type
179should be one of
180``stream'',
181``dgram'',
182``raw'',
183``rdm'',
184or
185``seqpacket'',
186depending on whether the socket is a stream, datagram, raw,
187reliably delivered message, or sequenced packet socket.
188.PP
189The
190.I protocol
191must be a valid protocol as given in
192.IR /etc/protocols .
193Examples might be
194``tcp''
195or
196``udp''.
197Rpc based services are specified with the
198``rpc/tcp''
199or
200``rpc/udp''
201service type.
202.PP
203The
204.I wait/nowait
205entry is used to tell
206.I inetd
207if it should wait for the server program to return,
208or continue processing connections on the socket.
209If a datagram server connects
210to its peer, freeing the socket so
211.I inetd
212can receive further messages on the socket, it is said to be
213a
214``multi-threaded''
215server, and should use the
216``nowait''
217entry.  For datagram servers which process all incoming datagrams
218on a socket and eventually time out, the server is said to be
219``single-threaded''
220and should use a
221``wait''
222entry.
223.B Comsat(8)
224and
225.B talkd(8)
226are both examples of the latter type of
227datagram server.
228.B Tftpd(8)
229is an exception; it is a datagram server that establishes pseudo-connections.
230It must be listed as
231``wait''
232in order to avoid a race;
233the server reads the first packet, creates a new socket,
234and then forks and exits to allow
235.I inetd
236to check for new service requests to spawn new servers.
237The optional
238``max''
239suffix (separated from
240``wait''
241or
242``nowait''
243by a dot) specifies the maximum number of server instances that may be
244spawned from
245.I inetd
246within an interval of 60 seconds. When omitted,
247``max''
248defaults to 40.
249.PP
250Stream servers are usually marked as
251``nowait''
252but if a single server process is to handle multiple connections, it may be
253marked as
254``wait''.
255The master socket will then be passed as fd 0 to the server, which will then
256need to accept the incoming connection.  The server should eventually time
257out and exit when no more connections are active.
258.I inetd
259will continue to
260listen on the master socket for connections, so the server should not close
261it when it exits.
262.B identd(8)
263is usually the only stream server marked as wait.
264.PP
265The
266.I switched/unswitched
267entry determines whether the service should always be on, or if it
268should be affected by the
269.B access_on(1)
270and
271.B access_off(1)
272commands. By default, when
273.I inetd
274is started, services which are switched will not be active, until they
275are started by
276.I access_on .
277If the -n option (``non-fascist'') is specified on the command line,
278then the switched services will be active by default.
279.PP
280.PP
281The
282.I user
283entry should contain the user name of the user as whom the server
284should run.  This allows for servers to be given less permission
285than root. An optional group name can be specified by appending a dot to
286the user name followed by the group name. This allows for servers to run with
287a different (primary) group id than specified in the password file. If a group
288is specified and user is not root, the supplementary groups associated with
289that user will still be set.
290.PP
291The
292.I server-program
293entry should contain the pathname of the program which is to be
294executed by
295.I inetd
296when a request is found on its socket.  If
297.I inetd
298provides this service internally, this entry should
299be
300``internal''.
301.PP
302The
303.I server program arguments
304should be just as arguments
305normally are, starting with argv[0], which is the name of
306the program.  If the service is provided internally, the
307word
308``internal''
309should take the place of this entry.
310.PP
311.I inetd
312provides several
313trivial
314services internally by use of
315routines within itself.  These services are
316``echo'',
317``discard'',
318``chargen''
319(character generator),
320``daytime''
321(human readable time), and
322``time''
323(machine readable time,
324in the form of the number of seconds since midnight, January
3251, 1900).  All of these services are tcp based.  For
326details of these services, consult the appropriate
327RFC
328from the Network Information Center.
329.PP
330.I inetd
331rereads its configuration file when it receives a hangup signal,
332.Dv SIGHUP .
333Services may be added, deleted or modified when the configuration file
334is reread.
335.I inetd
336creates a file
337.I /var/athena/inetd.pid
338that contains its process identifier.
339.SH BUGS
340Host address specifiers, while they make conceptual sense for RPC
341services, do not work entirely correctly.  This is largely because the
342portmapper interface does not provide a way to register different ports
343for the same service on different local addresses.  Provided you never
344have more than one entry for a given RPC service, everything should
345work correctly.  (Note that default host address specifiers do apply to
346RPC lines with no explicit specifier.)
347.SH SEE ALSO
348comsat(8),
349fingerd(8),
350ftpd(8),
351rexecd(8),
352rlogind(8),
353rshd(8),
354telnetd(8),
355tftpd(8),
356hosts_access(5),
357hosts_options(5)
358.SH HISTORY
359The
360.I inetd
361command appeared in
362BSD 4.3.
363Support for
364.I Sun-RPC
365based services is modeled after that
366provided by
367.I Sun-OS 4.1 .
Note: See TracBrowser for help on using the repository browser.