| 1 | .\" Copyright (c) 1985 The Regents of the University of California. |
| 2 | .\" All rights reserved. |
| 3 | .\" |
| 4 | .\" Redistribution and use in source and binary forms are permitted |
| 5 | .\" provided that the above copyright notice and this paragraph are |
| 6 | .\" duplicated in all such forms and that any documentation, |
| 7 | .\" advertising materials, and other materials related to such |
| 8 | .\" distribution and use acknowledge that the software was developed |
| 9 | .\" by the University of California, Berkeley. The name of the |
| 10 | .\" University may not be used to endorse or promote products derived |
| 11 | .\" from this software without specific prior written permission. |
| 12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
| 13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | .\" |
| 16 | .\" @(#)inetd.8 6.5 (Berkeley) %G% |
| 17 | .\" |
| 18 | .TH INETD 8 "" |
| 19 | .UC 6 |
| 20 | .SH NAME |
| 21 | inetd \- internet ``super\-server'' |
| 22 | .SH SYNOPSIS |
| 23 | .B /etc/inetd |
| 24 | [ |
| 25 | .B \-d |
| 26 | ] [ configuration file ] |
| 27 | .SH DESCRIPTION |
| 28 | .I Inetd |
| 29 | should be run at boot time by |
| 30 | .IR /etc/rc.local . |
| 31 | It then listens for connections on certain |
| 32 | internet sockets. When a connection is found on one |
| 33 | of its sockets, it decides what service the socket |
| 34 | corresponds to, and invokes a program to service the request. |
| 35 | After the program is |
| 36 | finished, it continues to listen on the socket (except in some cases which |
| 37 | will be described below). Essentially, |
| 38 | .I inetd |
| 39 | allows running one daemon to invoke several others, |
| 40 | reducing load on the system. |
| 41 | .PP |
| 42 | Upon execution, |
| 43 | .I inetd |
| 44 | reads its configuration information from a configuration |
| 45 | file which, by default, is |
| 46 | .IR /etc/inetd.conf . |
| 47 | There must be an entry for each field of the configuration |
| 48 | file, with entries for each field separated by a tab or |
| 49 | a space. Comments are denoted by a ``#'' at the beginning |
| 50 | of a line. There must be an entry for each field. The |
| 51 | fields of the configuration file are as follows: |
| 52 | .br |
| 53 | service name |
| 54 | .br |
| 55 | socket type |
| 56 | .br |
| 57 | protocol |
| 58 | .br |
| 59 | wait/nowait |
| 60 | .br |
| 61 | user |
| 62 | .br |
| 63 | server program |
| 64 | .br |
| 65 | server program arguments |
| 66 | .PP |
| 67 | The |
| 68 | .I service name |
| 69 | entry is the name of a valid service in |
| 70 | the file |
| 71 | .IR /etc/services/ . |
| 72 | For ``internal'' services (discussed below), the service |
| 73 | name |
| 74 | .I must |
| 75 | be the official name of the service (that is, the first entry in |
| 76 | .IR /etc/services ). |
| 77 | .PP |
| 78 | The |
| 79 | .I socket type |
| 80 | should be one of ``stream'', ``dgram'', ``raw'', ``rdm'', or ``seqpacket'', |
| 81 | depending on whether the socket is a stream, datagram, raw, |
| 82 | reliably delivered message, or sequenced packet socket. |
| 83 | .PP |
| 84 | The |
| 85 | .I protocol |
| 86 | must be a valid protocol as given in |
| 87 | .IR /etc/protocols . |
| 88 | Examples might be ``tcp'' or ``udp''. |
| 89 | .PP |
| 90 | The |
| 91 | .I wait/nowait |
| 92 | entry is applicable to datagram sockets only (other sockets should |
| 93 | have a ``nowait'' entry in this space). If a datagram server connects |
| 94 | to its peer, freeing the socket so |
| 95 | .I inetd |
| 96 | can received further messages on the socket, it is said to be |
| 97 | a ``multi-threaded'' server, and should use the ``nowait'' |
| 98 | entry. For datagram servers which process all incoming datagrams |
| 99 | on a socket and eventually time out, the server is said to be |
| 100 | ``single-threaded'' and should use a ``wait'' entry. ``Comsat'' (``biff'') |
| 101 | and ``talk'' are both examples of the latter type of |
| 102 | datagram server. |
| 103 | .I Tftpd |
| 104 | is an exception; it is a datagram server that establishes pseudo-connections. |
| 105 | It must be listed as ``wait'' in order to avoid a race; |
| 106 | the server reads the first packet, creates a new socket, |
| 107 | and then forks and exits to allow |
| 108 | .I inetd |
| 109 | to check for new service requests to spawn new servers. |
| 110 | .PP |
| 111 | The |
| 112 | .I user |
| 113 | entry should contain the user name of the user as whom the server |
| 114 | should run. This allows for servers to be given less permission |
| 115 | than root. |
| 116 | The |
| 117 | .I server program |
| 118 | entry should contain the pathname of the program which is to be |
| 119 | executed by |
| 120 | .I inetd |
| 121 | when a request is found on its socket. If |
| 122 | .I inetd |
| 123 | provides this service internally, this entry should |
| 124 | be ``internal''. |
| 125 | .PP |
| 126 | The arguments to the server program should be just as they |
| 127 | normally are, starting with argv[0], which is the name of |
| 128 | the program. If the service is provided internally, the |
| 129 | word ``internal'' should take the place of this entry. |
| 130 | .PP |
| 131 | .I Inetd |
| 132 | provides several ``trivial'' services internally by use of |
| 133 | routines within itself. These services are ``echo'', |
| 134 | ``discard'', ``chargen'' (character generator), ``daytime'' |
| 135 | (human readable time), and ``time'' (machine readable time, |
| 136 | in the form of the number of seconds since midnight, January |
| 137 | 1, 1900). All of these services are tcp based. For |
| 138 | details of these services, consult the appropriate RFC |
| 139 | from the Network Information Center. |
| 140 | .PP |
| 141 | .I Inetd |
| 142 | rereads its configuration file when it receives a hangup signal, SIGHUP. |
| 143 | Services may be added, deleted or modified when the configuration file |
| 144 | is reread. |
| 145 | .SH "SEE ALSO" |
| 146 | comsat(8), fingerd(8), ftpd(8), rexecd(8), rlogind(8), rshd(8), |
| 147 | telnetd(8), tftpd(8) |