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 |
---|
39 | inetd, 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 |
---|
51 | should be run at boot time |
---|
52 | It then listens for connections on certain |
---|
53 | internet sockets. When a connection is found on one |
---|
54 | of its sockets, it decides what service the socket |
---|
55 | corresponds to, and invokes a program to service the request. |
---|
56 | After the program is |
---|
57 | finished, it continues to listen on the socket (except in some cases which |
---|
58 | will be described below). Essentially, |
---|
59 | .I inetd |
---|
60 | allows running one daemon to invoke several others, |
---|
61 | reducing load on the system. |
---|
62 | .PP |
---|
63 | The options available for |
---|
64 | .I inetd: |
---|
65 | .PP |
---|
66 | .RS |
---|
67 | .IP \-d |
---|
68 | Turns on debugging. |
---|
69 | .PP |
---|
70 | .IP \-l |
---|
71 | Turns on libwrap connection logging. |
---|
72 | .PP |
---|
73 | .IP \-n |
---|
74 | Turns on ``switched'' services by default. |
---|
75 | .RE |
---|
76 | .PP |
---|
77 | Upon execution, |
---|
78 | .I inetd |
---|
79 | reads its configuration information from a configuration |
---|
80 | file which, by default, is |
---|
81 | .IR /etc/inetd.conf . |
---|
82 | There must be an entry for each field of the configuration |
---|
83 | file, with entries for each field separated by a tab or |
---|
84 | a space. Comments are denoted by a ``#'' at the beginning |
---|
85 | of a line. There must be an entry for each field (except for one |
---|
86 | special case, described below). The |
---|
87 | fields of the configuration file are as follows: |
---|
88 | .PP |
---|
89 | .RS |
---|
90 | service name |
---|
91 | .br |
---|
92 | socket type |
---|
93 | .br |
---|
94 | protocol |
---|
95 | .br |
---|
96 | wait/nowait[.max] |
---|
97 | .br |
---|
98 | switched/unswitched |
---|
99 | .br |
---|
100 | user[.group] |
---|
101 | .br |
---|
102 | server program |
---|
103 | .br |
---|
104 | server program arguments |
---|
105 | .RE |
---|
106 | .PP |
---|
107 | To specify a |
---|
108 | .I Sun-RPC |
---|
109 | based service, the entry would contain these fields. |
---|
110 | .PP |
---|
111 | .RS |
---|
112 | service name/version |
---|
113 | .br |
---|
114 | socket type |
---|
115 | .br |
---|
116 | rpc/protocol |
---|
117 | .br |
---|
118 | wait/nowait[.max] |
---|
119 | .br |
---|
120 | switched/unswitched |
---|
121 | .br |
---|
122 | user[.group] |
---|
123 | .br |
---|
124 | server program |
---|
125 | .br |
---|
126 | server program arguments |
---|
127 | .RE |
---|
128 | .PP |
---|
129 | For Internet services, the first field of the line may also have a host |
---|
130 | address specifier prefixed to it, separated from the service name by a |
---|
131 | colon. If this is done, the string before the colon in the first field |
---|
132 | indiciates what local address |
---|
133 | .I inetd |
---|
134 | should use when listening for that service, or the single character |
---|
135 | ``*'' |
---|
136 | to indicate |
---|
137 | INADDR_ANY, |
---|
138 | meaning |
---|
139 | all local addresses. |
---|
140 | To avoid repeating an address that occurs frequently, a line with a |
---|
141 | host address specifier and colon, but no further fields, causes the |
---|
142 | host address specifier to be remembered and used for all further lines |
---|
143 | with no explicit host specifier (until another such line or the end of |
---|
144 | the file). A line |
---|
145 | .PP |
---|
146 | *: |
---|
147 | .PP |
---|
148 | is implicitly provided at the top of the file; thus, traditional |
---|
149 | configuration files (which have no host address specifiers) will be |
---|
150 | interpreted in the traditional manner, with all services listened for |
---|
151 | on all local addresses. |
---|
152 | .PP |
---|
153 | The |
---|
154 | .I service-name |
---|
155 | entry is the name of a valid service in |
---|
156 | the file |
---|
157 | .IR /etc/services . |
---|
158 | For |
---|
159 | ``internal'' |
---|
160 | services (discussed below), the service |
---|
161 | name |
---|
162 | .I must |
---|
163 | be the official name of the service (that is, the first entry in |
---|
164 | .IR /etc/services ) . |
---|
165 | When used to specify a |
---|
166 | .I Sun-RPC |
---|
167 | based service, this field is a valid RPC service name in |
---|
168 | the file |
---|
169 | .IR /etc/rpc . |
---|
170 | The part on the right of the |
---|
171 | ``/'' |
---|
172 | is the RPC version number. This |
---|
173 | can simply be a single numeric argument or a range of versions. |
---|
174 | A range is bounded by the low version to the high version \- |
---|
175 | ``rusers/1-3''. |
---|
176 | .PP |
---|
177 | The |
---|
178 | .I socket-type |
---|
179 | should be one of |
---|
180 | ``stream'', |
---|
181 | ``dgram'', |
---|
182 | ``raw'', |
---|
183 | ``rdm'', |
---|
184 | or |
---|
185 | ``seqpacket'', |
---|
186 | depending on whether the socket is a stream, datagram, raw, |
---|
187 | reliably delivered message, or sequenced packet socket. |
---|
188 | .PP |
---|
189 | The |
---|
190 | .I protocol |
---|
191 | must be a valid protocol as given in |
---|
192 | .IR /etc/protocols . |
---|
193 | Examples might be |
---|
194 | ``tcp'' |
---|
195 | or |
---|
196 | ``udp''. |
---|
197 | Rpc based services are specified with the |
---|
198 | ``rpc/tcp'' |
---|
199 | or |
---|
200 | ``rpc/udp'' |
---|
201 | service type. |
---|
202 | .PP |
---|
203 | The |
---|
204 | .I wait/nowait |
---|
205 | entry is used to tell |
---|
206 | .I inetd |
---|
207 | if it should wait for the server program to return, |
---|
208 | or continue processing connections on the socket. |
---|
209 | If a datagram server connects |
---|
210 | to its peer, freeing the socket so |
---|
211 | .I inetd |
---|
212 | can receive further messages on the socket, it is said to be |
---|
213 | a |
---|
214 | ``multi-threaded'' |
---|
215 | server, and should use the |
---|
216 | ``nowait'' |
---|
217 | entry. For datagram servers which process all incoming datagrams |
---|
218 | on a socket and eventually time out, the server is said to be |
---|
219 | ``single-threaded'' |
---|
220 | and should use a |
---|
221 | ``wait'' |
---|
222 | entry. |
---|
223 | .B Comsat(8) |
---|
224 | and |
---|
225 | .B talkd(8) |
---|
226 | are both examples of the latter type of |
---|
227 | datagram server. |
---|
228 | .B Tftpd(8) |
---|
229 | is an exception; it is a datagram server that establishes pseudo-connections. |
---|
230 | It must be listed as |
---|
231 | ``wait'' |
---|
232 | in order to avoid a race; |
---|
233 | the server reads the first packet, creates a new socket, |
---|
234 | and then forks and exits to allow |
---|
235 | .I inetd |
---|
236 | to check for new service requests to spawn new servers. |
---|
237 | The optional |
---|
238 | ``max'' |
---|
239 | suffix (separated from |
---|
240 | ``wait'' |
---|
241 | or |
---|
242 | ``nowait'' |
---|
243 | by a dot) specifies the maximum number of server instances that may be |
---|
244 | spawned from |
---|
245 | .I inetd |
---|
246 | within an interval of 60 seconds. When omitted, |
---|
247 | ``max'' |
---|
248 | defaults to 40. |
---|
249 | .PP |
---|
250 | Stream servers are usually marked as |
---|
251 | ``nowait'' |
---|
252 | but if a single server process is to handle multiple connections, it may be |
---|
253 | marked as |
---|
254 | ``wait''. |
---|
255 | The master socket will then be passed as fd 0 to the server, which will then |
---|
256 | need to accept the incoming connection. The server should eventually time |
---|
257 | out and exit when no more connections are active. |
---|
258 | .I inetd |
---|
259 | will continue to |
---|
260 | listen on the master socket for connections, so the server should not close |
---|
261 | it when it exits. |
---|
262 | .B identd(8) |
---|
263 | is usually the only stream server marked as wait. |
---|
264 | .PP |
---|
265 | The |
---|
266 | .I switched/unswitched |
---|
267 | entry determines whether the service should always be on, or if it |
---|
268 | should be affected by the |
---|
269 | .B access_on(1) |
---|
270 | and |
---|
271 | .B access_off(1) |
---|
272 | commands. By default, when |
---|
273 | .I inetd |
---|
274 | is started, services which are switched will not be active, until they |
---|
275 | are started by |
---|
276 | .I access_on . |
---|
277 | If the -n option (``non-fascist'') is specified on the command line, |
---|
278 | then the switched services will be active by default. |
---|
279 | .PP |
---|
280 | .PP |
---|
281 | The |
---|
282 | .I user |
---|
283 | entry should contain the user name of the user as whom the server |
---|
284 | should run. This allows for servers to be given less permission |
---|
285 | than root. An optional group name can be specified by appending a dot to |
---|
286 | the user name followed by the group name. This allows for servers to run with |
---|
287 | a different (primary) group id than specified in the password file. If a group |
---|
288 | is specified and user is not root, the supplementary groups associated with |
---|
289 | that user will still be set. |
---|
290 | .PP |
---|
291 | The |
---|
292 | .I server-program |
---|
293 | entry should contain the pathname of the program which is to be |
---|
294 | executed by |
---|
295 | .I inetd |
---|
296 | when a request is found on its socket. If |
---|
297 | .I inetd |
---|
298 | provides this service internally, this entry should |
---|
299 | be |
---|
300 | ``internal''. |
---|
301 | .PP |
---|
302 | The |
---|
303 | .I server program arguments |
---|
304 | should be just as arguments |
---|
305 | normally are, starting with argv[0], which is the name of |
---|
306 | the program. If the service is provided internally, the |
---|
307 | word |
---|
308 | ``internal'' |
---|
309 | should take the place of this entry. |
---|
310 | .PP |
---|
311 | .I inetd |
---|
312 | provides several |
---|
313 | trivial |
---|
314 | services internally by use of |
---|
315 | routines 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, |
---|
324 | in the form of the number of seconds since midnight, January |
---|
325 | 1, 1900). All of these services are tcp based. For |
---|
326 | details of these services, consult the appropriate |
---|
327 | RFC |
---|
328 | from the Network Information Center. |
---|
329 | .PP |
---|
330 | .I inetd |
---|
331 | rereads its configuration file when it receives a hangup signal, |
---|
332 | .Dv SIGHUP . |
---|
333 | Services may be added, deleted or modified when the configuration file |
---|
334 | is reread. |
---|
335 | .I inetd |
---|
336 | creates a file |
---|
337 | .I /var/athena/inetd.pid |
---|
338 | that contains its process identifier. |
---|
339 | .SH BUGS |
---|
340 | Host address specifiers, while they make conceptual sense for RPC |
---|
341 | services, do not work entirely correctly. This is largely because the |
---|
342 | portmapper interface does not provide a way to register different ports |
---|
343 | for the same service on different local addresses. Provided you never |
---|
344 | have more than one entry for a given RPC service, everything should |
---|
345 | work correctly. (Note that default host address specifiers do apply to |
---|
346 | RPC lines with no explicit specifier.) |
---|
347 | .SH SEE ALSO |
---|
348 | comsat(8), |
---|
349 | fingerd(8), |
---|
350 | ftpd(8), |
---|
351 | rexecd(8), |
---|
352 | rlogind(8), |
---|
353 | rshd(8), |
---|
354 | telnetd(8), |
---|
355 | tftpd(8), |
---|
356 | hosts_access(5), |
---|
357 | hosts_options(5) |
---|
358 | .SH HISTORY |
---|
359 | The |
---|
360 | .I inetd |
---|
361 | command appeared in |
---|
362 | BSD 4.3. |
---|
363 | Support for |
---|
364 | .I Sun-RPC |
---|
365 | based services is modeled after that |
---|
366 | provided by |
---|
367 | .I Sun-OS 4.1 . |
---|