Commit | Line | Data |
---|---|---|
15637ed4 RG |
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 | .\" | |
b41acc45 | 32 | .\" from: @(#)inetd.8 6.7 (Berkeley) 3/16/91 |
159f9a1c | 33 | .\" $Id: inetd.8,v 1.2 1993/09/23 17:31:37 jtc Exp $ |
15637ed4 RG |
34 | .\" |
35 | .Dd March 16, 1991 | |
36 | .Dt INETD 8 | |
37 | .Os BSD 4.3 | |
38 | .Sh NAME | |
39 | .Nm inetd | |
40 | .Nd internet | |
41 | .Dq super-server | |
42 | .Sh SYNOPSIS | |
43 | .Nm inetd | |
44 | .Op Fl d | |
159f9a1c | 45 | .Op Fl l |
15637ed4 RG |
46 | .Op Ar configuration file |
47 | .Sh DESCRIPTION | |
48 | .Nm Inetd | |
49 | should be run at boot time by | |
50 | .Pa /etc/rc.local | |
51 | (see | |
52 | .Xr rc 8 ) . | |
53 | It then listens for connections on certain | |
54 | internet sockets. When a connection is found on one | |
55 | of its sockets, it decides what service the socket | |
56 | corresponds to, and invokes a program to service the request. | |
57 | After the program is | |
58 | finished, it continues to listen on the socket (except in some cases which | |
59 | will be described below). Essentially, | |
60 | .Nm inetd | |
61 | allows running one daemon to invoke several others, | |
62 | reducing load on the system. | |
63 | .Pp | |
64 | The option available for | |
65 | .Nm inetd: | |
66 | .Bl -tag -width Ds | |
67 | .It Fl d | |
68 | Turns on debugging. | |
159f9a1c RG |
69 | .It Fl l |
70 | Turns on logging. | |
15637ed4 RG |
71 | .El |
72 | .Pp | |
73 | Upon execution, | |
74 | .Nm inetd | |
75 | reads its configuration information from a configuration | |
76 | file which, by default, is | |
77 | .Pa /etc/inetd.conf . | |
78 | There must be an entry for each field of the configuration | |
79 | file, with entries for each field separated by a tab or | |
80 | a space. Comments are denoted by a ``#'' at the beginning | |
81 | of a line. There must be an entry for each field. The | |
82 | fields of the configuration file are as follows: | |
83 | .Pp | |
84 | .Bd -unfilled -offset indent -compact | |
85 | service name | |
86 | socket type | |
87 | protocol | |
88 | wait/nowait | |
89 | user | |
90 | server program | |
91 | server program arguments | |
92 | .Ed | |
93 | .Pp | |
b41acc45 C |
94 | To specify an |
95 | .Em Sun-RPC | |
96 | based service, the entry would contain these fields. | |
97 | .Pp | |
98 | .Bd -unfilled -offset indent -compact | |
99 | service name/version | |
100 | socket type | |
101 | rpc/protocol | |
102 | wait/nowait | |
103 | user | |
104 | server program | |
105 | server program arguments | |
106 | .Ed | |
107 | .Pp | |
15637ed4 RG |
108 | The |
109 | .Em service-name | |
110 | entry is the name of a valid service in | |
111 | the file | |
112 | .Pa /etc/services . | |
113 | For | |
114 | .Dq internal | |
115 | services (discussed below), the service | |
116 | name | |
117 | .Em must | |
118 | be the official name of the service (that is, the first entry in | |
b41acc45 C |
119 | .Pa /etc/services ) . |
120 | When used to specify a | |
121 | .Em Sun-RPC | |
122 | based service, this field is a valid RPC service name in | |
123 | the file | |
124 | .Pa /etc/rpc . | |
125 | The part on the right of the | |
126 | .Dq / | |
127 | is the RPC version number. This | |
128 | can simply be a single numeric argument or a range of versions. | |
129 | A range is bounded by the low version to the high version - | |
130 | .Dq rusers/1-3 . | |
131 | ||
15637ed4 RG |
132 | .Pp |
133 | The | |
134 | .Em socket-type | |
135 | should be one of | |
136 | .Dq stream , | |
137 | .Dq dgram , | |
138 | .Dq raw , | |
139 | .Dq rdm , | |
140 | or | |
141 | .Dq seqpacket , | |
142 | depending on whether the socket is a stream, datagram, raw, | |
143 | reliably delivered message, or sequenced packet socket. | |
144 | .Pp | |
145 | The | |
146 | .Em protocol | |
147 | must be a valid protocol as given in | |
148 | .Pa /etc/protocols . | |
149 | Examples might be | |
150 | .Dq tcp | |
151 | or | |
152 | .Dq udp . | |
b41acc45 C |
153 | Rpc based services are specified with the |
154 | .Dq rpc/tcp | |
155 | or | |
156 | .Dq rpc/udp | |
157 | service type. | |
158 | ||
15637ed4 RG |
159 | .Pp |
160 | The | |
161 | .Em wait/nowait | |
162 | entry is applicable to datagram sockets only (other sockets should | |
163 | have a | |
164 | .Dq nowait | |
165 | entry in this space). If a datagram server connects | |
166 | to its peer, freeing the socket so | |
167 | .Nm inetd | |
168 | can received further messages on the socket, it is said to be | |
169 | a | |
170 | .Dq multi-threaded | |
171 | server, and should use the | |
172 | .Dq nowait | |
173 | entry. For datagram servers which process all incoming datagrams | |
174 | on a socket and eventually time out, the server is said to be | |
175 | .Dq single-threaded | |
176 | and should use a | |
177 | .Dq wait | |
178 | entry. | |
179 | .Xr Comsat 8 | |
180 | .Pq Xr biff 1 | |
181 | and | |
182 | .Xr talkd 8 | |
183 | are both examples of the latter type of | |
184 | datagram server. | |
185 | .Xr Tftpd 8 | |
186 | is an exception; it is a datagram server that establishes pseudo-connections. | |
187 | It must be listed as | |
188 | .Dq wait | |
189 | in order to avoid a race; | |
190 | the server reads the first packet, creates a new socket, | |
191 | and then forks and exits to allow | |
192 | .Nm inetd | |
193 | to check for new service requests to spawn new servers. | |
194 | .Pp | |
195 | The | |
196 | .Em user | |
197 | entry should contain the user name of the user as whom the server | |
198 | should run. This allows for servers to be given less permission | |
199 | than root. | |
200 | .Pp | |
201 | The | |
202 | .Em server-program | |
203 | entry should contain the pathname of the program which is to be | |
204 | executed by | |
205 | .Nm inetd | |
206 | when a request is found on its socket. If | |
207 | .Nm inetd | |
208 | provides this service internally, this entry should | |
209 | be | |
210 | .Dq internal . | |
211 | .Pp | |
212 | The | |
213 | .Em server program arguments | |
214 | should be just as arguments | |
215 | normally are, starting with argv[0], which is the name of | |
216 | the program. If the service is provided internally, the | |
217 | word | |
218 | .Dq internal | |
219 | should take the place of this entry. | |
220 | .Pp | |
221 | .Nm Inetd | |
222 | provides several | |
223 | .Dq trivial | |
224 | services internally by use of | |
225 | routines within itself. These services are | |
226 | .Dq echo , | |
227 | .Dq discard , | |
228 | .Dq chargen | |
229 | (character generator), | |
230 | .Dq daytime | |
231 | (human readable time), and | |
232 | .Dq time | |
233 | (machine readable time, | |
234 | in the form of the number of seconds since midnight, January | |
235 | 1, 1900). All of these services are tcp based. For | |
236 | details of these services, consult the appropriate | |
237 | .Tn RFC | |
238 | from the Network Information Center. | |
239 | .Pp | |
159f9a1c RG |
240 | When given the |
241 | .Fl l | |
242 | option | |
243 | .Nm Inetd | |
244 | will log an entry to syslog each time an | |
245 | .Xr accept 2 | |
246 | is made, which notes the | |
247 | service selected and the IP-number of the remote requestor. | |
248 | .Pp | |
15637ed4 RG |
249 | .Nm Inetd |
250 | rereads its configuration file when it receives a hangup signal, | |
251 | .Dv SIGHUP . | |
252 | Services may be added, deleted or modified when the configuration file | |
253 | is reread. | |
254 | .Sh SEE ALSO | |
255 | .Xr comsat 8 , | |
256 | .Xr fingerd 8 , | |
257 | .Xr ftpd 8 , | |
258 | .Xr rexecd 8 , | |
259 | .Xr rlogind 8 , | |
260 | .Xr rshd 8 , | |
261 | .Xr telnetd 8 , | |
262 | .Xr tftpd 8 | |
263 | .Sh HISTORY | |
264 | The | |
265 | .Nm | |
266 | command appeared in | |
267 | .Bx 4.3 . | |
b41acc45 C |
268 | Support for |
269 | .Em Sun-RPC | |
270 | based services is modelled after that | |
271 | provided by | |
272 | .Em Sun-OS 4.1 . |