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

Revision 11726, 9.9 KB checked in by danw, 27 years ago (diff)
Port from NetBSD, add Athena inetd switched/unswitched behavior
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.
264The
265.I switched/unswitched
266entry determines whether the service should always be on, or if it
267should be affected by the
268.B access_on(1)
269and
270.B access_off(1)
271commands. By default, when
272.I inetd
273is started, services which are switched will not be active, until they
274are started by
275.I access_on .
276If the -n option (``non-fascist'') is specified on the command line,
277then the switched services will be active by default.
278.PP
279.PP
280The
281.I user
282entry should contain the user name of the user as whom the server
283should run.  This allows for servers to be given less permission
284than root. An optional group name can be specified by appending a dot to
285the user name followed by the group name. This allows for servers to run with
286a different (primary) group id than specified in the password file. If a group
287is specified and user is not root, the supplementary groups associated with
288that user will still be set.
289.PP
290The
291.I server-program
292entry should contain the pathname of the program which is to be
293executed by
294.I inetd
295when a request is found on its socket.  If
296.I inetd
297provides this service internally, this entry should
298be
299``internal''.
300.PP
301The
302.I server program arguments
303should be just as arguments
304normally are, starting with argv[0], which is the name of
305the program.  If the service is provided internally, the
306word
307``internal''
308should take the place of this entry.
309.PP
310.I inetd
311provides several
312trivial
313services internally by use of
314routines within itself.  These services are
315``echo'',
316``discard'',
317``chargen''
318(character generator),
319``daytime''
320(human readable time), and
321``time''
322(machine readable time,
323in the form of the number of seconds since midnight, January
3241, 1900).  All of these services are tcp based.  For
325details of these services, consult the appropriate
326RFC
327from the Network Information Center.
328.PP
329.I inetd
330rereads its configuration file when it receives a hangup signal,
331.Dv SIGHUP .
332Services may be added, deleted or modified when the configuration file
333is reread.
334.I inetd
335creates a file
336.I /var/athena/inetd.pid
337that contains its process identifier.
338.SH BUGS
339Host address specifiers, while they make conceptual sense for RPC
340services, do not work entirely correctly.  This is largely because the
341portmapper interface does not provide a way to register different ports
342for the same service on different local addresses.  Provided you never
343have more than one entry for a given RPC service, everything should
344work correctly.  (Note that default host address specifiers do apply to
345RPC lines with no explicit specifier.)
346.SH SEE ALSO
347comsat(8),
348fingerd(8),
349ftpd(8),
350rexecd(8),
351rlogind(8),
352rshd(8),
353telnetd(8),
354tftpd(8),
355hosts_access(5),
356hosts_options(5)
357.SH HISTORY
358The
359.I inetd
360command appeared in
361BSD 4.3.
362Support for
363.I Sun-RPC
364based services is modeled after that
365provided by
366.I Sun-OS 4.1 .
Note: See TracBrowser for help on using the repository browser.