Commit | Line | Data |
---|---|---|
b24337d5 WJ |
1 | .\" Copyright (c) 1985, 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)inetd.8 6.7 (Berkeley) 3/16/91 | |
33 | .\" | |
34 | .Dd March 16, 1991 | |
35 | .Dt INETD 8 | |
36 | .Os BSD 4.3 | |
37 | .Sh NAME | |
38 | .Nm inetd | |
39 | .Nd internet | |
40 | .Dq super-server | |
41 | .Sh SYNOPSIS | |
42 | .Nm inetd | |
43 | .Op Fl d | |
44 | .Op Ar configuration file | |
45 | .Sh DESCRIPTION | |
46 | .Nm Inetd | |
47 | should be run at boot time by | |
48 | .Pa /etc/rc.local | |
49 | (see | |
50 | .Xr rc 8 ) . | |
51 | It then listens for connections on certain | |
52 | internet sockets. When a connection is found on one | |
53 | of its sockets, it decides what service the socket | |
54 | corresponds to, and invokes a program to service the request. | |
55 | After the program is | |
56 | finished, it continues to listen on the socket (except in some cases which | |
57 | will be described below). Essentially, | |
58 | .Nm inetd | |
59 | allows running one daemon to invoke several others, | |
60 | reducing load on the system. | |
61 | .Pp | |
62 | The option available for | |
63 | .Nm inetd: | |
64 | .Bl -tag -width Ds | |
65 | .It Fl d | |
66 | Turns on debugging. | |
67 | .El | |
68 | .Pp | |
69 | Upon execution, | |
70 | .Nm inetd | |
71 | reads its configuration information from a configuration | |
72 | file which, by default, is | |
73 | .Pa /etc/inetd.conf . | |
74 | There must be an entry for each field of the configuration | |
75 | file, with entries for each field separated by a tab or | |
76 | a space. Comments are denoted by a ``#'' at the beginning | |
77 | of a line. There must be an entry for each field. The | |
78 | fields of the configuration file are as follows: | |
79 | .Pp | |
80 | .Bd -unfilled -offset indent -compact | |
81 | service name | |
82 | socket type | |
83 | protocol | |
84 | wait/nowait | |
85 | user | |
86 | server program | |
87 | server program arguments | |
88 | .Ed | |
89 | .Pp | |
90 | The | |
91 | .Em service-name | |
92 | entry is the name of a valid service in | |
93 | the file | |
94 | .Pa /etc/services . | |
95 | For | |
96 | .Dq internal | |
97 | services (discussed below), the service | |
98 | name | |
99 | .Em must | |
100 | be the official name of the service (that is, the first entry in | |
101 | .Pa /etc/services ) . | |
102 | .Pp | |
103 | The | |
104 | .Em socket-type | |
105 | should be one of | |
106 | .Dq stream , | |
107 | .Dq dgram , | |
108 | .Dq raw , | |
109 | .Dq rdm , | |
110 | or | |
111 | .Dq seqpacket , | |
112 | depending on whether the socket is a stream, datagram, raw, | |
113 | reliably delivered message, or sequenced packet socket. | |
114 | .Pp | |
115 | The | |
116 | .Em protocol | |
117 | must be a valid protocol as given in | |
118 | .Pa /etc/protocols . | |
119 | Examples might be | |
120 | .Dq tcp | |
121 | or | |
122 | .Dq udp . | |
123 | .Pp | |
124 | The | |
125 | .Em wait/nowait | |
126 | entry is applicable to datagram sockets only (other sockets should | |
127 | have a | |
128 | .Dq nowait | |
129 | entry in this space). If a datagram server connects | |
130 | to its peer, freeing the socket so | |
131 | .Nm inetd | |
132 | can received further messages on the socket, it is said to be | |
133 | a | |
134 | .Dq multi-threaded | |
135 | server, and should use the | |
136 | .Dq nowait | |
137 | entry. For datagram servers which process all incoming datagrams | |
138 | on a socket and eventually time out, the server is said to be | |
139 | .Dq single-threaded | |
140 | and should use a | |
141 | .Dq wait | |
142 | entry. | |
143 | .Xr Comsat 8 | |
144 | .Pq Xr biff 1 | |
145 | and | |
146 | .Xr talkd 8 | |
147 | are both examples of the latter type of | |
148 | datagram server. | |
149 | .Xr Tftpd 8 | |
150 | is an exception; it is a datagram server that establishes pseudo-connections. | |
151 | It must be listed as | |
152 | .Dq wait | |
153 | in order to avoid a race; | |
154 | the server reads the first packet, creates a new socket, | |
155 | and then forks and exits to allow | |
156 | .Nm inetd | |
157 | to check for new service requests to spawn new servers. | |
158 | .Pp | |
159 | The | |
160 | .Em user | |
161 | entry should contain the user name of the user as whom the server | |
162 | should run. This allows for servers to be given less permission | |
163 | than root. | |
164 | .Pp | |
165 | The | |
166 | .Em server-program | |
167 | entry should contain the pathname of the program which is to be | |
168 | executed by | |
169 | .Nm inetd | |
170 | when a request is found on its socket. If | |
171 | .Nm inetd | |
172 | provides this service internally, this entry should | |
173 | be | |
174 | .Dq internal . | |
175 | .Pp | |
176 | The | |
177 | .Em server program arguments | |
178 | should be just as arguments | |
179 | normally are, starting with argv[0], which is the name of | |
180 | the program. If the service is provided internally, the | |
181 | word | |
182 | .Dq internal | |
183 | should take the place of this entry. | |
184 | .Pp | |
185 | .Nm Inetd | |
186 | provides several | |
187 | .Dq trivial | |
188 | services internally by use of | |
189 | routines within itself. These services are | |
190 | .Dq echo , | |
191 | .Dq discard , | |
192 | .Dq chargen | |
193 | (character generator), | |
194 | .Dq daytime | |
195 | (human readable time), and | |
196 | .Dq time | |
197 | (machine readable time, | |
198 | in the form of the number of seconds since midnight, January | |
199 | 1, 1900). All of these services are tcp based. For | |
200 | details of these services, consult the appropriate | |
201 | .Tn RFC | |
202 | from the Network Information Center. | |
203 | .Pp | |
204 | .Nm Inetd | |
205 | rereads its configuration file when it receives a hangup signal, | |
206 | .Dv SIGHUP . | |
207 | Services may be added, deleted or modified when the configuration file | |
208 | is reread. | |
209 | .Sh SEE ALSO | |
210 | .Xr comsat 8 , | |
211 | .Xr fingerd 8 , | |
212 | .Xr ftpd 8 , | |
213 | .Xr rexecd 8 , | |
214 | .Xr rlogind 8 , | |
215 | .Xr rshd 8 , | |
216 | .Xr telnetd 8 , | |
217 | .Xr tftpd 8 | |
218 | .Sh HISTORY | |
219 | The | |
220 | .Nm | |
221 | command appeared in | |
222 | .Bx 4.3 . |