[11719] | 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 | .\" |
---|
[11726] | 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 |
---|
[11719] | 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, |
---|
[11726] | 59 | .I inetd |
---|
[11719] | 60 | allows running one daemon to invoke several others, |
---|
| 61 | reducing load on the system. |
---|
[11726] | 62 | .PP |
---|
[11719] | 63 | The options available for |
---|
[11726] | 64 | .I inetd: |
---|
| 65 | .PP |
---|
| 66 | .RS |
---|
| 67 | .IP \-d |
---|
[11719] | 68 | Turns on debugging. |
---|
[11726] | 69 | .PP |
---|
| 70 | .IP \-l |
---|
[11719] | 71 | Turns on libwrap connection logging. |
---|
[11726] | 72 | .PP |
---|
| 73 | .IP \-n |
---|
| 74 | Turns on ``switched'' services by default. |
---|
| 75 | .RE |
---|
| 76 | .PP |
---|
[11719] | 77 | Upon execution, |
---|
[11726] | 78 | .I inetd |
---|
[11719] | 79 | reads its configuration information from a configuration |
---|
| 80 | file which, by default, is |
---|
[11726] | 81 | .IR /etc/inetd.conf . |
---|
[11719] | 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: |
---|
[11726] | 88 | .PP |
---|
| 89 | .RS |
---|
[11719] | 90 | service name |
---|
[11726] | 91 | .br |
---|
[11719] | 92 | socket type |
---|
[11726] | 93 | .br |
---|
[11719] | 94 | protocol |
---|
[11726] | 95 | .br |
---|
[11719] | 96 | wait/nowait[.max] |
---|
[11726] | 97 | .br |
---|
| 98 | switched/unswitched |
---|
| 99 | .br |
---|
[11719] | 100 | user[.group] |
---|
[11726] | 101 | .br |
---|
[11719] | 102 | server program |
---|
[11726] | 103 | .br |
---|
[11719] | 104 | server program arguments |
---|
[11726] | 105 | .RE |
---|
| 106 | .PP |
---|
| 107 | To specify a |
---|
| 108 | .I Sun-RPC |
---|
[11719] | 109 | based service, the entry would contain these fields. |
---|
[11726] | 110 | .PP |
---|
| 111 | .RS |
---|
[11719] | 112 | service name/version |
---|
[11726] | 113 | .br |
---|
[11719] | 114 | socket type |
---|
[11726] | 115 | .br |
---|
[11719] | 116 | rpc/protocol |
---|
[11726] | 117 | .br |
---|
[11719] | 118 | wait/nowait[.max] |
---|
[11726] | 119 | .br |
---|
| 120 | switched/unswitched |
---|
| 121 | .br |
---|
[11719] | 122 | user[.group] |
---|
[11726] | 123 | .br |
---|
[11719] | 124 | server program |
---|
[11726] | 125 | .br |
---|
[11719] | 126 | server program arguments |
---|
[11726] | 127 | .RE |
---|
| 128 | .PP |
---|
[11719] | 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 |
---|
[11726] | 133 | .I inetd |
---|
[11719] | 134 | should use when listening for that service, or the single character |
---|
[11726] | 135 | ``*'' |
---|
[11719] | 136 | to indicate |
---|
[11726] | 137 | INADDR_ANY, |
---|
[11719] | 138 | meaning |
---|
[11726] | 139 | all local addresses. |
---|
[11719] | 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 |
---|
[11726] | 145 | .PP |
---|
| 146 | *: |
---|
| 147 | .PP |
---|
[11719] | 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. |
---|
[11726] | 152 | .PP |
---|
[11719] | 153 | The |
---|
[11726] | 154 | .I service-name |
---|
[11719] | 155 | entry is the name of a valid service in |
---|
| 156 | the file |
---|
[11726] | 157 | .IR /etc/services . |
---|
[11719] | 158 | For |
---|
[11726] | 159 | ``internal'' |
---|
[11719] | 160 | services (discussed below), the service |
---|
| 161 | name |
---|
[11726] | 162 | .I must |
---|
[11719] | 163 | be the official name of the service (that is, the first entry in |
---|
[11726] | 164 | .IR /etc/services ) . |
---|
[11719] | 165 | When used to specify a |
---|
[11726] | 166 | .I Sun-RPC |
---|
[11719] | 167 | based service, this field is a valid RPC service name in |
---|
| 168 | the file |
---|
[11726] | 169 | .IR /etc/rpc . |
---|
[11719] | 170 | The part on the right of the |
---|
[11726] | 171 | ``/'' |
---|
[11719] | 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 \- |
---|
[11726] | 175 | ``rusers/1-3''. |
---|
| 176 | .PP |
---|
[11719] | 177 | The |
---|
[11726] | 178 | .I socket-type |
---|
[11719] | 179 | should be one of |
---|
[11726] | 180 | ``stream'', |
---|
| 181 | ``dgram'', |
---|
| 182 | ``raw'', |
---|
| 183 | ``rdm'', |
---|
[11719] | 184 | or |
---|
[11726] | 185 | ``seqpacket'', |
---|
[11719] | 186 | depending on whether the socket is a stream, datagram, raw, |
---|
| 187 | reliably delivered message, or sequenced packet socket. |
---|
[11726] | 188 | .PP |
---|
[11719] | 189 | The |
---|
[11726] | 190 | .I protocol |
---|
[11719] | 191 | must be a valid protocol as given in |
---|
[11726] | 192 | .IR /etc/protocols . |
---|
[11719] | 193 | Examples might be |
---|
[11726] | 194 | ``tcp'' |
---|
[11719] | 195 | or |
---|
[11726] | 196 | ``udp''. |
---|
[11719] | 197 | Rpc based services are specified with the |
---|
[11726] | 198 | ``rpc/tcp'' |
---|
[11719] | 199 | or |
---|
[11726] | 200 | ``rpc/udp'' |
---|
[11719] | 201 | service type. |
---|
[11726] | 202 | .PP |
---|
[11719] | 203 | The |
---|
[11726] | 204 | .I wait/nowait |
---|
[11719] | 205 | entry is used to tell |
---|
[11726] | 206 | .I inetd |
---|
[11719] | 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 |
---|
[11726] | 211 | .I inetd |
---|
[11719] | 212 | can receive further messages on the socket, it is said to be |
---|
| 213 | a |
---|
[11726] | 214 | ``multi-threaded'' |
---|
[11719] | 215 | server, and should use the |
---|
[11726] | 216 | ``nowait'' |
---|
[11719] | 217 | entry. For datagram servers which process all incoming datagrams |
---|
| 218 | on a socket and eventually time out, the server is said to be |
---|
[11726] | 219 | ``single-threaded'' |
---|
[11719] | 220 | and should use a |
---|
[11726] | 221 | ``wait'' |
---|
[11719] | 222 | entry. |
---|
[11726] | 223 | .B Comsat(8) |
---|
[11719] | 224 | and |
---|
[11726] | 225 | .B talkd(8) |
---|
[11719] | 226 | are both examples of the latter type of |
---|
| 227 | datagram server. |
---|
[11726] | 228 | .B Tftpd(8) |
---|
[11719] | 229 | is an exception; it is a datagram server that establishes pseudo-connections. |
---|
| 230 | It must be listed as |
---|
[11726] | 231 | ``wait'' |
---|
[11719] | 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 |
---|
[11726] | 235 | .I inetd |
---|
[11719] | 236 | to check for new service requests to spawn new servers. |
---|
| 237 | The optional |
---|
[11726] | 238 | ``max'' |
---|
[11719] | 239 | suffix (separated from |
---|
[11726] | 240 | ``wait'' |
---|
[11719] | 241 | or |
---|
[11726] | 242 | ``nowait'' |
---|
[11719] | 243 | by a dot) specifies the maximum number of server instances that may be |
---|
| 244 | spawned from |
---|
[11726] | 245 | .I inetd |
---|
[11719] | 246 | within an interval of 60 seconds. When omitted, |
---|
[11726] | 247 | ``max'' |
---|
[11719] | 248 | defaults to 40. |
---|
[11726] | 249 | .PP |
---|
[11719] | 250 | Stream servers are usually marked as |
---|
[11726] | 251 | ``nowait'' |
---|
[11719] | 252 | but if a single server process is to handle multiple connections, it may be |
---|
| 253 | marked as |
---|
[11726] | 254 | ``wait''. |
---|
[11719] | 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. |
---|
[11726] | 258 | .I inetd |
---|
[11719] | 259 | will continue to |
---|
| 260 | listen on the master socket for connections, so the server should not close |
---|
| 261 | it when it exits. |
---|
[11726] | 262 | .B identd(8) |
---|
[11719] | 263 | is usually the only stream server marked as wait. |
---|
[12141] | 264 | .PP |
---|
[11719] | 265 | The |
---|
[11726] | 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 |
---|
[11719] | 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. |
---|
[11726] | 290 | .PP |
---|
[11719] | 291 | The |
---|
[11726] | 292 | .I server-program |
---|
[11719] | 293 | entry should contain the pathname of the program which is to be |
---|
| 294 | executed by |
---|
[11726] | 295 | .I inetd |
---|
[11719] | 296 | when a request is found on its socket. If |
---|
[11726] | 297 | .I inetd |
---|
[11719] | 298 | provides this service internally, this entry should |
---|
| 299 | be |
---|
[11726] | 300 | ``internal''. |
---|
| 301 | .PP |
---|
[11719] | 302 | The |
---|
[11726] | 303 | .I server program arguments |
---|
[11719] | 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 |
---|
[11726] | 308 | ``internal'' |
---|
[11719] | 309 | should take the place of this entry. |
---|
[11726] | 310 | .PP |
---|
| 311 | .I inetd |
---|
[11719] | 312 | provides several |
---|
[11726] | 313 | trivial |
---|
[11719] | 314 | services internally by use of |
---|
| 315 | routines within itself. These services are |
---|
[11726] | 316 | ``echo'', |
---|
| 317 | ``discard'', |
---|
| 318 | ``chargen'' |
---|
[11719] | 319 | (character generator), |
---|
[11726] | 320 | ``daytime'' |
---|
[11719] | 321 | (human readable time), and |
---|
[11726] | 322 | ``time'' |
---|
[11719] | 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 |
---|
[11726] | 327 | RFC |
---|
[11719] | 328 | from the Network Information Center. |
---|
[11726] | 329 | .PP |
---|
| 330 | .I inetd |
---|
[11719] | 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. |
---|
[11726] | 335 | .I inetd |
---|
[11719] | 336 | creates a file |
---|
[11726] | 337 | .I /var/athena/inetd.pid |
---|
[11719] | 338 | that contains its process identifier. |
---|
[11726] | 339 | .SH BUGS |
---|
[11719] | 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.) |
---|
[11726] | 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 |
---|
[11719] | 359 | The |
---|
[11726] | 360 | .I inetd |
---|
[11719] | 361 | command appeared in |
---|
[11726] | 362 | BSD 4.3. |
---|
[11719] | 363 | Support for |
---|
[11726] | 364 | .I Sun-RPC |
---|
[11719] | 365 | based services is modeled after that |
---|
| 366 | provided by |
---|
[11726] | 367 | .I Sun-OS 4.1 . |
---|