Commit | Line | Data |
---|---|---|
b42074ab | 1 | .\" Copyright (c) 1985, 1991 The Regents of the University of California. |
fd869580 | 2 | .\" All rights reserved. |
55270cae | 3 | .\" |
dcebbf27 | 4 | .\" %sccs.include.redist.man% |
fd869580 | 5 | .\" |
b42074ab | 6 | .\" @(#)inetd.8 6.7 (Berkeley) %G% |
55270cae | 7 | .\" |
b42074ab CL |
8 | .Dd |
9 | .Dt INETD 8 | |
10 | .Os BSD 4.3 | |
11 | .Sh NAME | |
12 | .Nm inetd | |
13 | .Nd internet | |
14 | .Dq super-server | |
15 | .Sh SYNOPSIS | |
16 | .Nm inetd | |
17 | .Op Fl d | |
18 | .Op Ar configuration file | |
19 | .Sh DESCRIPTION | |
20 | .Nm Inetd | |
55270cae | 21 | should be run at boot time by |
b42074ab CL |
22 | .Pa /etc/rc.local |
23 | (see | |
24 | .Xr rc 8 ) . | |
55270cae KM |
25 | It then listens for connections on certain |
26 | internet sockets. When a connection is found on one | |
27 | of its sockets, it decides what service the socket | |
28 | corresponds to, and invokes a program to service the request. | |
29 | After the program is | |
30 | finished, it continues to listen on the socket (except in some cases which | |
31 | will be described below). Essentially, | |
b42074ab | 32 | .Nm inetd |
55270cae KM |
33 | allows running one daemon to invoke several others, |
34 | reducing load on the system. | |
b42074ab CL |
35 | .Pp |
36 | The option available for | |
37 | .Nm inetd: | |
38 | .Bl -tag -width Ds | |
39 | .It Fl d | |
40 | Turns on debugging. | |
41 | .El | |
42 | .Pp | |
55270cae | 43 | Upon execution, |
b42074ab | 44 | .Nm inetd |
55270cae KM |
45 | reads its configuration information from a configuration |
46 | file which, by default, is | |
b42074ab | 47 | .Pa /etc/inetd.conf . |
55270cae KM |
48 | There must be an entry for each field of the configuration |
49 | file, with entries for each field separated by a tab or | |
50 | a space. Comments are denoted by a ``#'' at the beginning | |
51 | of a line. There must be an entry for each field. The | |
52 | fields of the configuration file are as follows: | |
b42074ab CL |
53 | .Pp |
54 | .Bd -unfilled -offset indent -compact | |
55 | service name | |
56 | socket type | |
57 | protocol | |
58 | wait/nowait | |
59 | user | |
60 | server program | |
61 | server program arguments | |
62 | .Ed | |
63 | .Pp | |
55270cae | 64 | The |
b42074ab | 65 | .Em service-name |
55270cae KM |
66 | entry is the name of a valid service in |
67 | the file | |
b42074ab CL |
68 | .Pa /etc/services . |
69 | For | |
70 | .Dq internal | |
71 | services (discussed below), the service | |
55270cae | 72 | name |
b42074ab | 73 | .Em must |
63c183b7 | 74 | be the official name of the service (that is, the first entry in |
b42074ab CL |
75 | .Pa /etc/services ) . |
76 | .Pp | |
55270cae | 77 | The |
b42074ab CL |
78 | .Em socket-type |
79 | should be one of | |
80 | .Dq stream , | |
81 | .Dq dgram , | |
82 | .Dq raw , | |
83 | .Dq rdm , | |
84 | or | |
85 | .Dq seqpacket , | |
55270cae KM |
86 | depending on whether the socket is a stream, datagram, raw, |
87 | reliably delivered message, or sequenced packet socket. | |
b42074ab | 88 | .Pp |
55270cae | 89 | The |
b42074ab | 90 | .Em protocol |
55270cae | 91 | must be a valid protocol as given in |
b42074ab CL |
92 | .Pa /etc/protocols . |
93 | Examples might be | |
94 | .Dq tcp | |
95 | or | |
96 | .Dq udp . | |
97 | .Pp | |
55270cae | 98 | The |
b42074ab | 99 | .Em wait/nowait |
55270cae | 100 | entry is applicable to datagram sockets only (other sockets should |
b42074ab CL |
101 | have a |
102 | .Dq nowait | |
103 | entry in this space). If a datagram server connects | |
55270cae | 104 | to its peer, freeing the socket so |
b42074ab | 105 | .Nm inetd |
55270cae | 106 | can received further messages on the socket, it is said to be |
b42074ab CL |
107 | a |
108 | .Dq multi-threaded | |
109 | server, and should use the | |
110 | .Dq nowait | |
55270cae KM |
111 | entry. For datagram servers which process all incoming datagrams |
112 | on a socket and eventually time out, the server is said to be | |
b42074ab CL |
113 | .Dq single-threaded |
114 | and should use a | |
115 | .Dq wait | |
116 | entry. | |
117 | .Xr Comsat 8 | |
118 | .Pq Xr biff 1 | |
119 | and | |
120 | .Xr talkd 8 | |
121 | are both examples of the latter type of | |
55270cae | 122 | datagram server. |
b42074ab | 123 | .Xr Tftpd 8 |
63c183b7 | 124 | is an exception; it is a datagram server that establishes pseudo-connections. |
b42074ab CL |
125 | It must be listed as |
126 | .Dq wait | |
127 | in order to avoid a race; | |
63c183b7 MK |
128 | the server reads the first packet, creates a new socket, |
129 | and then forks and exits to allow | |
b42074ab | 130 | .Nm inetd |
63c183b7 | 131 | to check for new service requests to spawn new servers. |
b42074ab | 132 | .Pp |
55270cae | 133 | The |
b42074ab | 134 | .Em user |
55270cae KM |
135 | entry should contain the user name of the user as whom the server |
136 | should run. This allows for servers to be given less permission | |
137 | than root. | |
b42074ab | 138 | .Pp |
55270cae | 139 | The |
b42074ab | 140 | .Em server-program |
55270cae KM |
141 | entry should contain the pathname of the program which is to be |
142 | executed by | |
b42074ab | 143 | .Nm inetd |
55270cae | 144 | when a request is found on its socket. If |
b42074ab | 145 | .Nm inetd |
55270cae | 146 | provides this service internally, this entry should |
b42074ab CL |
147 | be |
148 | .Dq internal . | |
149 | .Pp | |
150 | The | |
151 | .Em server program arguments | |
152 | should be just as arguments | |
55270cae KM |
153 | normally are, starting with argv[0], which is the name of |
154 | the program. If the service is provided internally, the | |
b42074ab CL |
155 | word |
156 | .Dq internal | |
157 | should take the place of this entry. | |
158 | .Pp | |
159 | .Nm Inetd | |
160 | provides several | |
161 | .Dq trivial | |
162 | services internally by use of | |
163 | routines within itself. These services are | |
164 | .Dq echo , | |
165 | .Dq discard , | |
166 | .Dq chargen | |
167 | (character generator), | |
168 | .Dq daytime | |
169 | (human readable time), and | |
170 | .Dq time | |
171 | (machine readable time, | |
55270cae KM |
172 | in the form of the number of seconds since midnight, January |
173 | 1, 1900). All of these services are tcp based. For | |
b42074ab CL |
174 | details of these services, consult the appropriate |
175 | .Tn RFC | |
55270cae | 176 | from the Network Information Center. |
b42074ab CL |
177 | .Pp |
178 | .Nm Inetd | |
179 | rereads its configuration file when it receives a hangup signal, | |
180 | .Dv SIGHUP . | |
f8cbfd03 MK |
181 | Services may be added, deleted or modified when the configuration file |
182 | is reread. | |
b42074ab CL |
183 | .Sh SEE ALSO |
184 | .Xr comsat 8 , | |
185 | .Xr fingerd 8 , | |
186 | .Xr ftpd 8 , | |
187 | .Xr rexecd 8 , | |
188 | .Xr rlogind 8 , | |
189 | .Xr rshd 8 , | |
190 | .Xr telnetd 8 , | |
191 | .Xr tftpd 8 | |
192 | .Sh HISTORY | |
193 | The | |
194 | .Nm | |
195 | command appeared in | |
196 | .Bx 4.3 . |