fixes init script for non ipv6 enabled systems #472755
[packages/xinetd.git] / xinetd / xinetd.conf.man
1 .\"(c) Copyright 1992, by Panagiotis Tsirigotis
2 .\"(c) Sections Copyright 1998-2001 by Rob Braun
3 .\"All rights reserved.  The file named COPYRIGHT specifies the terms 
4 .\"and conditions for redistribution.
5 .\"
6 .\" $Id: xinetd.conf.man,v 1.18 2005/10/05 17:15:33 bbraun Exp $
7 .TH XINETD.CONF 5 "14 June 2001"
8 .\" *************************** NAME *********************************
9 .SH NAME
10 xinetd.conf \- Extended Internet Services Daemon configuration file
11 .\" *********************** DESCRIPTION ****************************
12 .SH DESCRIPTION
13 .B "xinetd.conf"
14 is the configuration file that
15 determines the services provided by \fBxinetd\fP.
16 Any line whose first non-white-space character is a '#' is considered
17 a comment line. Empty lines are ignored.
18 .LP
19 The file contains entries of the form:
20 .RS
21 .nf
22 .ft B
23 .sp
24 service <service_name>
25 {
26 .RS
27 .ft B
28 <attribute> <assign_op> <value> <value> ...
29 .I "..."
30 .RE
31 }
32 .ft R
33 .fi
34 .RE
35 .LP
36 The assignment operator,
37 .I assign_op,
38 can be one of 
39 .B '=', 
40 .B '+=',
41 .B '-='.
42 The majority of attributes support only the simple assignment operator,
43 .B '='.
44 Attributes whose value is a set of values support all assignment operators.
45 For such attributes,
46 .B '+=' 
47 means adding a value to the set and 
48 .B '-='
49 means removing a value from the set.
50 A list of these attributes will be given
51 after all the attributes are described.
52 .LP
53 Each entry defines a service identified by the \fIservice_name\fP.
54 The following is a list of available attributes:
55 .TP 17
56 .B id
57 This attribute is used to uniquely identify a service.
58 This is useful because there exist services that can use different 
59 protocols and need to be described with different entries in the
60 configuration file.
61 By default, the service id is the same as the service name.
62 .TP
63 .B type
64 Any combination of the following values may be used:
65 .RS
66 .TP 12
67 .B RPC
68 if this is an RPC service
69 .TP
70 .B INTERNAL
71 if this is a service provided by \fBxinetd\fP.
72 .TP
73 .B TCPMUX/TCPMUXPLUS
74 if this is a service that will be started according to the RFC 1078 protocol on the TCPMUX well-known port. See the section describing TCPMUX services below.
75 .TP
76 .B UNLISTED
77 if this is a service not listed in a standard system file
78 (like
79 .I /etc/rpc 
80 for RPC services, or
81 .I /etc/services
82 for non-RPC services).
83 .RE
84 .TP
85 .B flags
86 Any combination of the following flags may be used:
87 .RS
88 .TP 12
89 .B INTERCEPT
90 Intercept packets or accepted connections in order to verify that they
91 are coming from acceptable locations (internal or multi-threaded
92 services cannot be intercepted).
93 .TP
94 .B NORETRY
95 Avoid retry attempts in case of fork failure.
96 .TP
97 .B IDONLY
98 Accept connections only when the remote end identifies the remote user
99 (i.e. the remote host must run an identification server).
100 This flag applies only to connection-based services.
101 This flag is ineffective if the
102 .B USERID
103 log option is not used.
104 .TP
105 .B NAMEINARGS
106 This will cause the first argument in "server_args" to be argv[0] when
107 executing the server, as specified in "server".  This allows you to use
108 tcpd by putting tcpd in "server" and the name of the server in "server_args"
109 like in normal inetd.
110 .TP
111 .B NODELAY
112 If the service is a tcp service and the NODELAY flag is set, then the
113 TCP_NODELAY flag will be set on the socket.  If the service is not
114 a tcp service, this option has no effect.
115 .TP
116 .B KEEPALIVE
117 If the service is a tcp service and the KEEPALIVE flag is set, then 
118 the SO_KEEPALIVE socket flag will be set on the socket.  If the service
119 is not a tcp service, this option has no effect.
120 .TP
121 .B NOLIBWRAP
122 This disables internal calling of the tcpwrap library to determine access
123 to the service.  This may be needed in order to use libwrap functionality
124 not available to long-running processes such as xinetd; in this case,
125 the tcpd program can be called explicitly (see also the NAMEINARGS flag).
126 .TP
127 .B SENSOR
128 This replaces the service with a sensor that detects accesses to the 
129 specified port. NOTE: It will NOT detect stealth scans. This flag 
130 should be used only on services that you know you don't need. When an 
131 access is made to this service's port, the IP Address is added to a global
132 no_access list. This causes all subsequent accesses from the originating IP
133 address to be denied access until the deny_time setting expires. The amount
134 of time spent on this list is configurable as the deny_time attribute. The
135 SENSOR flag will also cause xinetd to consider the server attribute to be
136 INTERNAL no matter what is typed on the same line. Another important thing
137 to remember is that if the socket_type is set to stream, then the wait 
138 attribute should be set to no.
139 .TP
140 .B IPv4
141 Sets the service to be an IPv4 service (AF_INET).
142 .TP
143 .B IPv6
144 Sets the service to be an IPv6 service (AF_INET6), if IPv6 is available on the system.
145 .TP
146 .B REUSE
147 The REUSE flag is deprecated.  All services now implicitly use the REUSE flag.
148 .RE
149 .TP
150 .B disable
151 This is boolean "yes" or "no".  This will result in the service
152 being disabled and not starting.  See the DISABLE flag description.
153 .RE
154 .TP
155 .B socket_type
156 Possible values for this attribute include:
157 .RS
158 .TP 12
159 .I stream
160 stream-based service
161 .TP
162 .I dgram
163 datagram-based service
164 .TP
165 .I raw
166 service that requires direct access to IP
167 .TP
168 .I seqpacket
169 service that requires reliable sequential datagram transmission
170 .RE
171 .TP
172 .B protocol
173 determines the protocol that is employed by the service.
174 The protocol must exist in
175 .I /etc/protocols.
176 If this
177 attribute is not defined, the default protocol employed by the service
178 will be used.
179 .TP
180 .B wait
181 This attribute determines if the service is single-threaded or
182 multi-threaded and whether or not xinetd accepts the connection or the server
183 program accepts the connection. If its value is \fIyes\fP, the service is 
184 single-threaded; this means that \fBxinetd\fP will start the server and then 
185 it will stop handling requests for the service until the server dies and that
186 the server software will accept the connection. If the attribute value is 
187 \fIno\fP, the service is multi-threaded and \fBxinetd\fP will keep handling 
188 new service requests and xinetd will accept the connection. It should be noted 
189 that udp/dgram services normally expect the value to be yes since udp is not
190 connection oriented, while tcp/stream servers normally expect the value to be
191 no.
192 .TP
193 .B user
194 determines the uid for the server process. The user attribute can either 
195 be numeric or a name. If a name is given (recommended),  the user name must 
196 exist in
197 .I /etc/passwd.
198 This attribute is ineffective if the effective user ID 
199 of \fBxinetd\fP is not super-user.
200 .TP
201 .B group
202 determines the gid for the server process. The group attribute can either
203 be numeric or a name. If a name is given (recommended), the group name must 
204 exist in
205 .I /etc/group.
206 If a group is not specified, the group
207 of \fIuser\fP will be used (from 
208 .I /etc/passwd).
209 This attribute is ineffective if the effective user ID 
210 of \fBxinetd\fP is not super-user and if the \fBgroups\fP attribute
211 is not set to 'yes'.
212 .TP
213 .B instances
214 determines the number of servers that can be simultaneously active
215 for a service (the default is no limit). The value of this
216 attribute can be either a number or
217 .B UNLIMITED
218 which means that there is no limit.
219 .TP
220 .B nice
221 determines the server priority. Its value is a (possibly negative) number;
222 check nice(3) for more information.
223 .TP
224 .B server
225 determines the program to execute for this service.
226 .TP
227 .B server_args
228 determines the arguments passed to the server. In contrast to \fBinetd\fP,
229 the server name should \fInot\fP be included in \fIserver_args\fP.
230 .TP
231 +.B libwrap
232 overrides the service name passed to libwrap (which defaults to the
233 server name, the first server_args component with NAMEINARGS, the id
234 for internal services and the service name for redirected services).
235 This attribute is only valid if xinetd has been configured with the libwrap
236 option.
237 .TP
238 .B only_from
239 determines the remote hosts to which the particular
240 service is available.
241 Its value is a list of IP addresses which can be specified in any
242 combination of the following ways:
243 .RS
244 .TP 5
245 .B a)
246 a numeric address in the form of %d.%d.%d.%d. If the rightmost components are 
247 0, they are treated as wildcards 
248 (for example, 128.138.12.0 matches all hosts on the 128.138.12 subnet).
249 0.0.0.0 matches all Internet addresses.  IPv6 hosts may be specified in the form of abcd:ef01::2345:6789.  The rightmost rule for IPv4 addresses does not apply to IPv6 addresses.
250 .TP
251 .B b)
252 a factorized address in the form of %d.%d.%d.{%d,%d,...}.
253 There is no need for all 4 components (i.e. %d.%d.{%d,%d,...%d} is also ok).
254 However, the factorized part must be at the end of the address.  This form does not work for IPv6 hosts.
255 .TP
256 .B c)
257 a network name (from
258 .I /etc/networks).  This form does not work for IPv6 hosts.
259 .TP
260 .B d)
261 a host name.  When a connection is made to xinetd, a reverse lookup is
262 performed, and the canonical name returned is compared to the specified host
263 name.  You may also use domain names in the form of .domain.com.  If the
264 reverse lookup of the client's IP is within .domain.com, a match occurs.
265 .TP
266 .B e)
267 an ip address/netmask range in the form of 1.2.3.4/32.  IPv6 address/netmask
268 ranges in the form of 1234::/46 are also valid.
269 .RE
270 .TP
271 .B ""
272 Specifying this attribute
273 without a value makes the service available to nobody.
274 .TP
275 .B no_access
276 determines the remote hosts to which the particular
277 service is unavailable. Its value can be specified in the same way as the
278 value of the \fBonly_from\fP
279 attribute. These two attributes determine the location access control 
280 enforced by \fBxinetd\fP. If none of the two is specified for a service,
281 the service is available to anyone. If both are specified for a service,
282 the one that is the better match for
283 the address of the remote host determines
284 if the service is available to that host (for example, if the 
285 \fBonly_from\fP list contains 128.138.209.0 and the
286 \fBno_access\fP list contains 128.138.209.10
287 then the host with the address 128.138.209.10 can not access the service).
288 .TP
289 .B access_times
290 determines the time intervals when the service is available. An interval
291 has the form \fIhour:min-hour:min\fP (connections 
292 .I will 
293 be accepted at the bounds of an interval). Hours can range from 0 to 23 and
294 minutes from 0 to 59.
295 .TP
296 .B log_type
297 determines where the service log output is sent. There are two formats:
298 .RS
299 .TP
300 .B SYSLOG " \fIsyslog_facility [syslog_level]\fP"
301 The log output is sent to syslog at the specified facility. Possible facility
302 names include:
303 .I daemon,
304 .I auth,
305 .I authpriv,
306 .I user,
307 .I mail,
308 .I lpr,
309 .I news,
310 .I uucp,
311 .I ftp
312 .I "local0-7."
313 Possible level names include:
314 .I emerg,
315 .I alert,
316 .I crit,
317 .I err,
318 .I warning,
319 .I notice,
320 .I info,
321 .I debug.
322 If a level is not present, the messages will be recorded at the
323 .I info
324 level.
325 .TP
326 .B FILE " \fIfile [soft_limit [hard_limit]]\fP"
327 The log output is appended to \fIfile\fP which will be created if it does
328 not exist. Two limits on the size of the log file can be optionally specified.
329 The first limit is a soft one;
330 .B xinetd 
331 will log a message the first time this limit is exceeded (if 
332 .B xinetd
333 logs to syslog, the message will be sent at the 
334 .I alert
335 priority level).
336 The second limit is a hard limit; 
337 .B xinetd 
338 will stop logging for the affected service (if the log file is a
339 common log file, then more than one service may be affected)
340 and will log a message about this (if
341 .B xinetd
342 logs to syslog, the message will be sent at the 
343 .I alert
344 priority level).
345 If a hard limit is not specified, it defaults to the soft limit
346 increased by 1% but the extra size must be within the parameters
347 .SM LOG_EXTRA_MIN
348 and
349 .SM LOG_EXTRA_MAX
350 which default to 5K and 20K respectively (these constants are defined in 
351 \fIxconfig.h\fP).
352 .RE
353 .TP
354 .B log_on_success
355 determines what information is logged when a server is started and when
356 that server exits (the service id is always included in the log entry).
357 Any combination of the following values may be specified:
358 .RS
359 .TP 12
360 .B PID
361 logs the server process id (if the service is implemented by \fBxinetd\fP
362 without forking another process the logged process id will be 0)
363 .TP
364 .B HOST
365 logs the remote host address
366 .TP
367 .B USERID
368 logs the user id of the remote user using the RFC 1413 identification protocol.
369 This option is available only for multi-threaded stream services.
370 .TP
371 .B EXIT
372 logs the fact that a server exited along with the exit status or the
373 termination signal
374 (the process id is also logged if the
375 .B PID
376 option is used)
377 .TP
378 .B DURATION 
379 logs the duration of a service session
380 .TP
381 .B TRAFFIC
382 logs the total bytes in and out for a redirected service.
383 .RE
384 .TP
385 .B log_on_failure
386 determines what information is logged when a server cannot be started
387 (either because of a lack of resources or because of access control
388 restrictions). The service id is always included in the log entry along
389 with the reason for failure.
390 Any combination of the following values may be specified:
391 .RS
392 .TP 12
393 .B HOST
394 logs the remote host address.
395 .TP
396 .B USERID
397 logs the user id of the remote user using the RFC 1413 identification protocol.
398 This option is available only for multi-threaded stream services.
399 .TP 
400 .B ATTEMPT
401 logs the fact that a failed attempt was made
402 (this option is implied by all others).
403 .RE
404 .TP
405 .B rpc_version
406 determines the RPC version for a RPC service. The version can be
407 a single number or a range in the form \fInumber\fP-\fInumber\fP.
408 .TP
409 .B rpc_number
410 determines the number for an
411 .I UNLISTED
412 RPC service (this attribute is ignored if the service is not unlisted).
413 .TP
414 .B env
415 The value of this attribute is a list of strings of the form 'name=value'.
416 These strings will be added to the environment before
417 starting a server (therefore the server's environment will include
418 \fBxinetd\fP's environment plus the specified strings).
419 .TP
420 .B passenv
421 The value of this attribute is a list of environment variables from
422 \fBxinetd\fP's environment that will be passed to the server.
423 An empty list implies passing no variables to the server
424 except for those explicitly defined using the
425 .I env
426 attribute.
427 (notice that you can use this attribute in conjunction with the
428 .I env
429 attribute to specify exactly what environment will be passed to the server).
430 .TP
431 .B port
432 determines the service port. If this attribute is specified for a service 
433 listed in
434 .I /etc/services,
435 it must be equal to the port number listed in that file.
436 .TP
437 .B redirect
438 Allows a tcp service to be redirected to another host.  When xinetd receives
439 a tcp connection on this port it spawns a process that establishes a
440 connection to the host and port number specified, and forwards all data
441 between the two hosts.  This option is useful when your internal machines
442 are not visible to the outside world.  Syntax is: redirect = (ip address) 
443 (port).  You can also use a hostname instead of the IP address in this
444 field.  The hostname lookup is performed only once, when xinetd is 
445 started, and the first IP address returned is the one that is used
446 until xinetd is restarted.
447 The "server" attribute is not required when this option is specified.  If
448 the "server" attribute is specified, this attribute takes priority.
449 .TP
450 .B bind
451 Allows a service to be bound to a specific interface on the machine.
452 This means you can have a telnet server listening on a local, secured
453 interface, and not on the external interface.  Or one port on one interface
454 can do something, while the same port on a different interface can do 
455 something completely different.  Syntax: bind = (ip address of interface).
456 .TP
457 .B interface
458 Synonym for bind.
459 .TP
460 .B banner
461 Takes the name of a file to be splatted at the remote host when a 
462 connection to that service is established.  This banner is printed
463 regardless of access control.  It should *always* be printed when
464 a connection has been made.  \fBxinetd\fP outputs the file as-is,
465 so you must ensure the file is correctly formatted for the service's
466 protocol.  In paticular, if the protocol requires CR-LF pairs for line
467 termination, you must supply them.
468 .TP
469 .B banner_success
470 Takes the name of a file to be splatted at the remote host when a
471 connection to that service is granted.  This banner is printed
472 as soon as access is granted for the service.  \fBxinetd\fP outputs the
473 file as-is, so you must ensure the file is correctly formatted for
474 the service's protocol.  In paticular, if the protocol requires CR-LF
475 pairs for line termination, you must supply them.
476 .TP
477 .B banner_fail
478 Takes the name of a file to be splatted at the remote host when a
479 connection to that service is denied.  This banner is printed 
480 immediately upon denial of access.  This is useful for informing
481 your users that they are doing something bad and they shouldn't be
482 doing it anymore.  \fBxinetd\fP outputs the file as-is,
483 so you must ensure the file is correctly formatted for the service's
484 protocol.  In paticular, if the protocol requires CR-LF pairs for line
485 termination, you must supply them.
486 .TP
487 .B per_source
488 Takes an integer or "UNLIMITED" as an argument.  This specifies the
489 maximum instances of this service per source IP address.  This can
490 also be specified in the defaults section.
491 .TP
492 .B cps
493 Limits the rate of incoming connections.  Takes two arguments.  
494 The first argument is the number of connections per second to handle.
495 If the rate of incoming connections is higher than this, the service
496 will be temporarily disabled.  The second argument is the number of
497 seconds to wait before re-enabling the service after it has been disabled.
498 The default for this setting is 50 incoming connections and the interval
499 is 10 seconds.
500 .TP
501 .B max_load
502 Takes a floating point value as the load at which the service will 
503 stop accepting connections.  For example: 2 or 2.5.  The service
504 will stop accepting connections at this load.  This is the one minute
505 load average.  This is an OS dependent feature, and currently only
506 Linux, Solaris, and FreeBSD are supported for this.  This feature is
507 only avaliable if xinetd was configured with the -with-loadavg option.
508 .TP
509 .B groups
510 Takes either "yes" or "no".  If the groups attribute is set to
511 "yes", then the server is executed with access to the groups that the
512 server's effective UID has access to.  Alternatively, if the \fBgroup\fP
513 attribute is set, the server is executed with access to the groups
514 specified.  If the groups attribute is set 
515 to "no", then the server runs with no supplementary groups.  This
516 attribute must be set to "yes" for many BSD systems.  This attribute
517 can be set in the defaults section as well.
518 .TP
519 .B mdns
520 Takes either "yes" or "no".  On systems that support mdns registration
521 of services (currently only Mac OS X), this will enable or disable
522 registration of the service.  This defaults to "yes".
523 .TP
524 .B umask
525 Sets the inherited umask for the service.  Expects an octal value.  
526 This option may be set in the "defaults" section to set a umask
527 for all services.  xinetd sets its own umask to the previous umask
528 OR'd with 022.  This is the umask that will be inherited by all 
529 child processes if the umask option is not used.
530 .TP
531 .B enabled
532 Takes a list of service ID's to enable.  This will enable only the
533 services listed as arguments to this attribute; the rest will be
534 disabled.  If you have 2 ftp services, you will need to list both of
535 their ID's and not just ftp. (ftp is the service name, not the ID. It
536 might accidentally be the ID, but you better check.) Note that the 
537 service "disable" attribute and "DISABLE" flag can prevent a service 
538 from being enabled despite being listed in this attribute. 
539 .TP
540 .B include
541 Takes a filename in the form of "include /etc/xinetd/service".
542 The file is then parsed as a new configuration file.  It is not 
543 the same thing as pasting the file into xinetd.conf where the 
544 include directive is given.  The included file must be in the 
545 same form as xinetd.conf.  This may not be specified from within
546 a service.  It must be specified outside a service declaration.
547 .TP
548 .B includedir
549 Takes a directory name in the form of "includedir /etc/xinetd.d".
550 Every file inside that directory, excluding files with names containing
551 a dot ('.') or ending with a tilde ('~'), will be parsed as xinetd 
552 configuration files.  The files will be parsed in alphabetical order
553 according to the C locale. This allows you to specify services one 
554 per file within a directory.  The
555 .B includedir
556 directive may not be specified from within a service declaration.  
557 .TP
558 .B rlimit_as
559 Sets the Address Space resource limit for the service. One parameter
560 is required, which is either a positive integer representing the number
561 of bytes to set the limit to (K or M may be used to specify
562 kilobytes/megabytes) or "UNLIMITED".  Due to the way Linux's libc malloc
563 is implemented, it is more useful to set this limit than rlimit_data,
564 rlimit_rss and rlimit_stack. This resource limit is only implemented on
565 Linux systems.
566 .TP
567 .B rlimit_cpu
568 Sets the maximum number of CPU seconds that the service may use.
569 One parameter is required, which is either a positive integer representing
570 the number of CPU seconds limit to, or "UNLIMITED".
571 .TP
572 .B rlimit_data
573 Sets the maximum data size resource limit for the service.
574 One parameter is required, which is either a positive integer representing
575 the number of bytes or "UNLIMITED".
576 .TP
577 .B rlimit_rss
578 Sets the maximum resident set size limit for the service.  Setting this
579 value low will make the process a likely candidate for swapping out to
580 disk when memory is low.
581 One parameter is required, which is either a positive integer representing
582 the number of bytes or "UNLIMITED".
583 .TP
584 .B rlimit_stack
585 Set the maximum stack size limit for the service.
586 One parameter is required, which is either a positive integer representing
587 the number of bytes or "UNLIMITED".
588 .TP
589 .B deny_time
590 Sets the time span that access to all services on all IP addresses are
591 denied to someone that sets off the SENSOR. The unit of time is in minutes.
592 Valid options are: FOREVER, NEVER, and a numeric value. FOREVER causes
593 the IP address not to be purged until xinetd is restarted. NEVER has the
594 effect of just logging the offending IP address. A typical time value would
595 be 60 minutes. This should stop most DOS attacks while allowing IP addresses
596 that come from a pool to be recycled for legitimate purposes. This option
597 must be used in conjunction with the SENSOR flag.
598 .LP
599 You don't need to specify all of the above attributes for each service.
600 The necessary attributes for a service are:
601 .sp 1
602 .PD .1v
603 .RS
604 .TP 18
605 .B socket_type
606 .TP
607 .B user
608 (non-\fIinternal\fP services only)
609 .TP
610 .B server
611 (non-\fIinternal\fP services only)
612 .TP
613 .B wait
614 .TP
615 .B protocol
616 (\fIRPC\fP and \fIunlisted\fP services only)
617 .TP
618 .B rpc_version
619 (\fIRPC\fP services only)
620 .TP
621 .B rpc_number
622 (\fIunlisted\fP RPC services only)
623 .TP
624 .B port
625 (\fIunlisted\fP non-RPC services only)
626 .RE
627 .PD
628 .LP
629 The following attributes support all assignment operators:
630 .sp 1
631 .PD .1v
632 .RS
633 .TP 18
634 .B only_from
635 .TP
636 .B no_access
637 .TP
638 .B log_on_success
639 .TP
640 .B log_on_failure
641 .TP
642 .B passenv
643 .TP
644 .B env
645 (does not support the
646 .B '-='
647 operator)
648 .RE
649 .PD
650 .LP
651 These attributes can also appear more than once in a service entry.
652 The remaining attributes support only the 
653 .B '='
654 operator and can appear at most once in a service entry.
655 .LP
656 The configuration file may also contain a single defaults entry
657 that has the form
658 .LP
659 .RS
660 .nf
661 .ft B
662 defaults
663 {
664 .RS
665 .ft B
666 <attribute> = <value> <value> ...
667 .I "..."
668 .RE
669 .ft B
670 }
671 .ft R
672 .fi
673 .RE
674 .LP
675 This entry provides default attribute values for service entries that
676 don't specify those attributes. Possible default attributes:
677 .sp 1
678 .PD .1v
679 .RS
680 .TP 18
681 .B log_type
682 (cumulative effect)
683 .TP
684 .B bind 
685 .TP
686 .B per_source 
687 .TP
688 .B umask 
689 .TP
690 .B log_on_success
691 (cumulative effect)
692 .TP
693 .B log_on_failure
694 (cumulative effect)
695 .TP
696 .B only_from
697 (cumulative effect)
698 .TP
699 .B no_access
700 (cumulative effect)
701 .TP
702 .B passenv
703 (cumulative effect)
704 .TP
705 .B instances
706 .TP
707 .B disabled
708 (cumulative effect)
709 .TP
710 .B enabled
711 (cumulative effect)
712 .TP
713 .B banner 
714 .TP
715 .B banner_success 
716 .TP
717 .B banner_fail
718 .TP
719 .B per_source 
720 .TP
721 .B groups 
722 .TP
723 .B cps 
724 .TP
725 .B max_load 
726 .TP
727 .RE
728 .PD
729 .LP
730 Attributes with a cumulative effect can be specified multiple times
731 with the values specified each time accumulating (i.e. '=' does
732 the same thing as '+=').
733 With the exception of
734 .I disabled
735 they all have the same meaning as if they were specified in a service entry.
736 .I disabled
737 determines services that are disabled even if they have entries in
738 the configuration file. This allows for quick reconfiguration by
739 specifying disabled services with the
740 .I disabled
741 attribute instead of commenting them out.
742 The value of this attribute is a list of space separated service ids.
743 .I enabled 
744 has the same properties as disabled.  The difference being that
745 .I enabled 
746 is a list of which services are to be enabled.  If 
747 .I enabled 
748 is specified, only the services specified are available.  If
749 .I enabled 
750 is not specified, all services are assumed to be enabled,
751 except those listed in 
752 .I disabled.
753
754 .\" *********************** INTERNAL SERVICES ****************************
755 .SH "INTERNAL SERVICES"
756 .LP
757 \fBxinetd\fP provides the following services internally (both
758 stream and datagram based):
759 .I echo,
760 .I time,
761 .I daytime,
762 .I chargen,
763 and
764 .I discard.
765 These services are under the same access restrictions as all other
766 services except for the ones that don't require \fBxinetd\fP to fork
767 another process for them. Those ones (\fItime\fP, \fIdaytime\fP,
768 and the datagram-based \fIecho\fP, \fIchargen\fP, and \fIdiscard\fP) 
769 have no limitation in the number of 
770 .B instances.
771 .LP
772 .\" *********************** TCPMUX Services ****************************
773 .SH "TCPMUX Services"
774 .LP
775 \fBxinetd\fP supports TCPMUX services that conform to RFC 1078. These services 
776 may not have a well-known port associated with them, and can be accessed via 
777 the TCPMUX well-known port.
778 .LP
779 For each service that is to be accessed via TCPMUX, a service entry in
780 \fB/etc/xinetd.conf\fP or in a configuration file in an \fBincludedir\fP 
781 directory must exist.
782 .LP
783 The \fIservice_name\fP field (as defined above for each service in any 
784 \fBxinetd\fP 
785 configuration file) must be identical to the string that is passed (according 
786 to RFC 1078 protocol) to \fBxinetd\fP when the remote service requestor first 
787 makes the connection on the TCPMUX well-known port.  Private protocols should 
788 use a service name that has a high probability of being unique. One way is to 
789 prepend the service name with some form of organization ID.
790 .LP
791 The \fItype\fP field can be either \fBTCPMUX\fP or \fBTCPMUXPLUS\fP. If the
792 type is \fBTCPMUXPLUS\fP, \fBxinetd\fP will handle the initial protocol
793 handshake (as defined in RFC 1078) with the calling process before initiating
794 the service. If the type is \fBTCPMUX\fP, the server that is started is
795 responsible for performing the handshake.
796 .LP
797 The \fItype\fP field should also include \fBUNLISTED\fP if the service is
798 not listed in a standard system file
799 (like
800 .I /etc/rpc
801 for RPC services, or
802 .I /etc/services
803 for non-RPC services).
804 .LP     
805 The \fIsocket_type\fP for these services must be \fBstream\fP, and the 
806 \fIprotocol\fP must be \fBtcp\fP.
807 .LP
808 Following is a sample TCPMUX service configuration:
809 .PD .1v
810 .RS
811 .nf
812
813 service myorg_server
814 {
815 .RS
816 .IP disable 20
817 = no
818 .IP type
819 = TCPMUX
820 .IP socket_type
821 = stream
822 .IP protocol
823 = tcp
824 .IP wait
825 = no
826 .IP user
827 = root
828 .IP server
829 = /usr/etc/my_server_exec
830 .RE
831 }
832 .fi
833 .RE
834 .PD
835 .LP
836 Besides a service entry for each service that can be accessed
837 via the TCPMUX well-known port, a service entry for TCPMUX itself
838 must also be included in the \fBxinetd\fP configuration. Consider the following
839 sample:
840 .PD .1v
841 .RS
842 .nf
843
844 service tcpmux
845 {
846 .RS
847 .IP type 20
848 = INTERNAL
849 .IP id
850 = tcpmux
851 .IP socket_type
852 = stream
853 .IP protocol
854 = tcp
855 .IP user
856 = root
857 .IP wait
858 = no
859 .RE
860 }
861 .fi
862 .RE
863 .PD                                                                               
864
865
866
867 .\" *********************** NOTES ****************************
868 .SH NOTES
869 .IP 1. 4
870 The following service attributes \fIcannot\fP be changed on reconfiguration:
871 .B socket_type,
872 .B wait,
873 .B protocol,
874 .B type.
875 .IP 2.
876 When the attributes
877 .I only_from
878 and
879 .I no_access
880 are not specified for a service (either directly or via \fIdefaults\fP)
881 the address check is considered successful (i.e. access will not be
882 denied).
883 .IP 3.
884 The address check is based on the IP address of the remote host and
885 not on its domain address. We do this so that we can avoid
886 remote name lookups which may take a long time (since
887 .B xinetd
888 is single-threaded, a name lookup will prevent the daemon from
889 accepting any other requests until the lookup is resolved).
890 The down side of this scheme is that if the IP address of a remote
891 host changes, then access to that host may be denied until
892 .B xinetd
893 is reconfigured.
894 Whether access is actually denied or not will depend on whether the
895 new host IP address is among those allowed access. For example, if
896 the IP address of a host changes from 1.2.3.4 to 1.2.3.5 and 
897 only_from is specified as 1.2.3.0 then access will not be denied.
898 .IP 4.
899 If the
900 .B USERID
901 log option is specified and the remote host either does not run an 
902 identification server or the server sends back a bad reply,
903 access will not be denied unless the
904 .I IDONLY
905 service flag is used.
906 .IP 5.
907 Interception works by forking a process which acts as a filter
908 between the remote host(s) and the local server. 
909 This obviously has a performance impact so
910 it is up to you to make the compromise between security and performance
911 for each service.
912 The following tables show the overhead of interception.
913 The first table shows the time overhead-per-datagram for a UDP-based service
914 using various datagram sizes.
915 For TCP-based services we measured the bandwidth reduction 
916 because of interception while sending
917 a certain amount of data from client to server (the time overhead should
918 the same as for UDP-based services but it is "paid" only by the first
919 packet of a continuous data transmission).
920 The amount of data is given
921 in the table as \fIsystem_calls\fPx\fIdata_sent_per_call\fP, i.e.
922 each
923 .I "send(2)"
924 system call transferred so many bytes of data. 
925 The bandwidth reduction is given in terms of bytes per second and as
926 a percentage of the bandwidth when interception is not performed.
927 All measurements were done on a SparcStation IPC running SunOS 4.1.
928 .sp 1
929 .RS
930 .RS
931 .PD .1v
932 .TP 25
933 Datagram size (bytes)
934 Latency (msec)
935 .TP
936 ---------------------
937 --------------
938 .TP
939 64
940 1.19
941 .TP
942 256
943 1.51
944 .TP
945 1024
946 1.51
947 .TP
948 4096
949 3.58
950 .sp 2
951 .TP
952 Bytes sent
953 Bandwidth reduction
954 .TP
955 ----------
956 -------------------
957 .TP
958 10000x64
959 941 (1.2%)
960 .TP
961 10000x256
962 4,231 (1.8%)
963 .TP
964 10000x1024
965 319,300 (39.5%)
966 .TP
967 10000x4096
968 824,461 (62.1%)
969 .RE
970 .RE
971 .sp 1
972 .\" *********************** EXAMPLE ****************************
973 .SH EXAMPLE
974 .LP
975 .PD .1v
976 .RS
977 .nf
978 #
979 # Sample configuration file for xinetd
980 #
981
982 defaults
983 {
984 .RS
985 .IP log_type 20
986 = FILE /var/log/servicelog
987 .IP log_on_success
988 = PID
989 .IP log_on_failure 
990 = HOST 
991 .IP only_from
992 = 128.138.193.0 128.138.204.0 
993 .IP only_from
994 = 128.138.252.1 
995 .IP instances
996 = 10
997 .IP disabled
998 = rstatd
999 .RE
1000 }
1001
1002 #
1003 # Note 1: the protocol attribute is not required
1004 # Note 2: the instances attribute overrides the default
1005 #
1006 service login
1007 {
1008 .RS
1009 .IP socket_type 20
1010 = stream
1011 .IP protocol
1012 = tcp
1013 .IP wait
1014 = no
1015 .IP user
1016 = root
1017 .IP server
1018 = /usr/etc/in.rlogind
1019 .IP instances
1020 = UNLIMITED
1021 .RE
1022 }
1023
1024 #
1025 # Note 1: the instances attribute overrides the default
1026 # Note 2: the log_on_success flags are augmented
1027 #
1028 service shell
1029 {
1030 .RS
1031 .IP socket_type 20
1032 = stream
1033 .IP wait
1034 = no
1035 .IP user
1036 = root
1037 .IP instances
1038 = UNLIMITED
1039 .IP server
1040 = /usr/etc/in.rshd
1041 .IP log_on_success
1042 += HOST 
1043 .RE
1044 }
1045
1046 service ftp
1047 {
1048 .RS
1049 .IP socket_type 20
1050 = stream
1051 .IP wait
1052 = no
1053 .IP nice
1054 = 10
1055 .IP user
1056 = root
1057 .IP server
1058 = /usr/etc/in.ftpd
1059 .IP server_args
1060 = -l
1061 .IP instances
1062 = 4
1063 .IP log_on_success
1064 += DURATION HOST USERID
1065 .IP access_times
1066 = 2:00-9:00 12:00-24:00
1067 .RE
1068 }
1069
1070 # Limit telnet sessions to 8 Mbytes of memory and a total
1071 # 20 CPU seconds for child processes.
1072 service telnet
1073 {
1074 .RS
1075 .IP socket_type 20
1076 = stream
1077 .IP wait
1078 = no
1079 .IP nice
1080 = 10
1081 .IP user
1082 = root
1083 .IP server
1084 = /usr/etc/in.telnetd
1085 .IP rlimit_as
1086 = 8M
1087 .IP rlimit_cpu
1088 = 20
1089 .RE
1090 }
1091
1092 #
1093 # This entry and the next one specify internal services. Since
1094 # this is the same service using a different socket type, the
1095 # id attribute is used to uniquely identify each entry
1096 #
1097 service echo
1098 {
1099 .RS
1100 .IP id 20
1101 = echo-stream
1102 .IP type
1103 = INTERNAL
1104 .IP socket_type
1105 = stream
1106 .IP user
1107 = root
1108 .IP wait
1109 = no
1110 .RE
1111 }
1112
1113 service echo
1114 {
1115 .RS
1116 .IP id 20
1117 = echo-dgram
1118 .IP type
1119 = INTERNAL
1120 .IP socket_type
1121 = dgram
1122 .IP user
1123 = root
1124 .IP wait
1125 = no
1126 .RE
1127 }
1128
1129 #
1130 # Sample RPC service
1131 #
1132 service rstatd
1133 {
1134 .RS
1135 .IP type 20
1136 = RPC
1137 .IP socket_type
1138 = dgram
1139 .IP protocol
1140 = udp
1141 .IP server
1142 = /usr/etc/rpc.rstatd
1143 .IP wait
1144 = yes
1145 .IP user
1146 = root
1147 .IP rpc_version
1148 = 2-4
1149 .IP env
1150 = LD_LIBRARY_PATH=/etc/securelib
1151 .RE
1152 }
1153
1154 #
1155 # Sample unlisted service
1156 #
1157 service unlisted
1158 {
1159 .RS
1160 .IP type 20
1161 = UNLISTED
1162 .IP socket_type
1163 = stream
1164 .IP protocol
1165 = tcp
1166 .IP wait
1167 = no
1168 .IP server
1169 = /home/user/some_server
1170 .IP port
1171 = 20020
1172 .RE
1173 }
1174 .RE
1175 .PD
1176 .\" *********************** SEE ALSO ****************************
1177 .SH "SEE ALSO"
1178 .I "xinetd(1L),"
1179 .LP
1180 .I "xinetd.log(5)"
1181 .LP
1182 Postel J.,
1183 .IR "Echo Protocol" ,
1184 RFC 862,
1185 May 1983
1186 .LP
1187 Postel J.,
1188 .IR "Discard Protocol" ,
1189 RFC 863,
1190 May 1983
1191 .LP
1192 Postel J.,
1193 .IR "Character Generator Protocol" ,
1194 RFC 864,
1195 May 1983
1196 .LP
1197 Postel J.,
1198 .IR "Daytime Protocol" ,
1199 RFC 867,
1200 May 1983
1201 .LP
1202 Postel J., Harrenstien K.,
1203 .IR "Time Protocol" ,
1204 RFC 868,
1205 May 1983
1206 .LP
1207 M. Lottor,
1208 .IR "TCP Port Service Multiplexer (TCPMUX)" ,
1209 RFC 1078
1210 Nov 1988
1211 .LP
1212 StJohns M.,
1213 .IR " Identification Protocol" ,
1214 RFC 1413,
1215 February 1993
1216 .\" *********************** BUGS ****************************
1217 .SH BUGS
1218 .LP
1219 If the
1220 .B INTERCEPT
1221 flag is not used,
1222 access control on the address of the remote host is not performed when
1223 \fIwait\fP is \fIyes\fP and \fIsocket_type\fP is \fIstream\fP.
1224 .LP
1225 If the 
1226 .B INTERCEPT
1227 flag is not used,
1228 access control on the address of the remote host for
1229 services where \fIwait\fP is \fIyes\fP and \fIsocket_type\fP is \fIdgram\fP
1230 is performed only on the first packet. The server may then accept packets
1231 from hosts not in the access control list. This can happen with 
1232 .B RPC
1233 services.
1234 .LP
1235 There is no way to put a
1236 .SM SPACE
1237 in an environment variable.
1238 .LP
1239 When \fIwait\fP is \fIyes\fP and \fIsocket_type\fP is \fIstream\fP,
1240 the socket passed to the server can only accept connections.
1241 .LP
1242 The
1243 .B INTERCEPT
1244 flag is not supported for internal services or multi-threaded services.