📄 inetd.8
字号:
.\" Copyright (c) 1985, 1991 The Regents of the University of California..\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" from: @(#)inetd.8 6.7 (Berkeley) 3/16/91.\" $Id: inetd.8,v 1.18 2000/07/30 23:56:58 dholland Exp $.\".Dd August 22, 1999.Dt INETD 8.Os "Linux NetKit (0.17)".Sh NAME.Nm inetd.Nd internet.Dq super-server.Sh SYNOPSIS.Nm inetd.Op Fl di.Op Fl q Ar queuelength.Op Ar configuration file.Sh DESCRIPTION.Nm Inetdshould be run at boot time by.Pa /etc/rc.local(see.Xr rc 8 ) .If your .Xr init 8can respawn arbitrary daemons,.Nm inetdcan be run from init instead; then init will restart it if it crashes.You must use the.Fl ioption to prevent.Nm inetdfrom backgrounding itself, or init will become confused..PpWhen running,.Nm inetd listens for connections on certaininternet sockets. When a connection is found on one of its sockets, it looks up what service the socket corresponds to, and invokes a program to service the request. After the program is finished, it will continue to listen on the socket, except in some special cases which will be described below. Essentially,.Nm inetdallows running one daemon to invoke several others,reducing load on the system..Ss OPTIONSThe options available for.Nm inetd:.Bl -tag -width Ds.It Fl dTurns on several kinds of debugging and make inetd behave if run in a debugger. Also implies.Fl i ..It Fl iDo not background; for running from.Xr init 8 ..It Fl q Ar queuelengthSets the size of the socket listen queue to the specifiedvalue. Default is 128..El.Ss CONFIGURATIONUpon execution,.Nm inetdreads its configuration information from a configurationfile which, by default, is.Pa /etc/inetd.conf .There must be an entry for each field of the configurationfile, with entries for each field separated by a tab ora space. Comments are denoted by a ``#'' at the beginningof a line. There must be an entry for each field. Thefields of the configuration file are as follows:.Pp.Bd -unfilled -offset indent -compactservice name[@hostname]socket typeprotocolwait/nowait[.max]user[.group]server programserver program arguments.Ed.PpTo specify an .Em Sun-RPC based service, the entry would contain these fields..Pp.Bd -unfilled -offset indent -compactservice name/version[@hostname]socket typerpc/protocolwait/nowait[.max]user[.group]server programserver program arguments.Ed.PpThe.Em service-nameentry is the name of a valid service inthe file.Pa /etc/services .For.Dq internalservices (discussed below), the servicename.Em mustbe the official name of the service (that is, the first entry in.Pa /etc/services ) . When used to specify a.Em Sun-RPCbased service, this field is a valid RPC service name inthe file.Pa /etc/rpc . The part on the right of the .Dq /is the RPC version number. Thiscan simply be a single numeric argument or a range of versions.A range is bounded by the low version to the high version - .Dq rusers/1-3 ..PpIf a string of the form.Em @hostname is appended to the service, it causes inetd to bind to the port forthe service on only the specific IP address associated with.Em hostname ,instead of listening on all available addresses. This can be done asmany times as desired for different addresses, which permits settingup ``virtually hosted'' services. Note, however, that while you canlisten to as many specific addresses as you want, kernel restrictionsprevent .Nm inetdfrom listening to the same port on a specific address and the generaladdress at once..Em hostnameshould be a resolvable hostname or an IP address associated with oneof the interfaces of the local system..PpThe.Em socket-typeshould be one of.Dq stream ,.Dq dgram ,.Dq raw ,.Dq rdm ,or.Dq seqpacket ,depending on whether the socket is a stream, datagram, raw,reliably delivered message, or sequenced packet socket..PpThe.Em protocolmust be a valid protocol as given in.Pa /etc/protocols .Examples might be.Dq tcpor.Dq udp .Rpc based services are specified with the .Dq rpc/tcpor .Dq rpc/udp service type..PpThe.Em wait/nowaitentry is applicable to datagram sockets only (other sockets shouldhave a.Dq nowaitentry in this space). If a datagram server connectsto its peer, freeing the socket so.Nm inetdcan received further messages on the socket, it is said to bea.Dq multi-threadedserver, and should use the.Dq nowaitentry. For datagram servers which process all incoming datagramson a socket and eventually time out, the server is said to be.Dq single-threadedand should use a.Dq waitentry..Xr Comsat 8.Pq Xr biff 1and.Xr talkd 8are both examples of the latter type ofdatagram server..Xr Tftpd 8is an exception; it is a datagram server that establishes pseudo-connections.It must be listed as.Dq waitin order to avoid a race;the server reads the first packet, creates a new socket,and then forks and exits to allow.Nm inetdto check for new service requests to spawn new servers.The optional.Dq maxsuffix (separated from.Dq waitor.Dq nowaitby a dot) specifies the maximum number of server instances that may bespawned from.Nm inetdwithin an interval of 60 seconds. When omitted,.Dq maxdefaults to 40..PpThe.Em userentry should contain the user name of the user as whom the servershould run. This allows for servers to be given less permissionthan root. An optional group name can be specified by appending a dot tothe user name followed by the group name. This allows for servers to run witha different (primary) group id than specified in the password file. If a groupis specified and user is not root, the supplementary groups associated withthat user will still be set..PpThe.Em server-programentry should contain the pathname of the program which is to beexecuted by.Nm inetdwhen a request is found on its socket. If.Nm inetdprovides this service internally, this entry shouldbe.Dq internal ..PpThe.Em server program argumentsshould be just as argumentsnormally are, starting with argv[0], which is the name ofthe program. If the service is provided internally, theword.Dq internalshould take the place of this entry..Ss BUILTINS.Nm Inetdprovides several.Dq trivialservices internally by use ofroutines within itself. These services are.Dq echo ,.Dq discard ,.Dq chargen(character generator),.Dq daytime(human readable time), and.Dq time(machine readable time,in the form of the number of seconds since midnight, January1, 1900). All of these services are tcp based. Fordetails of these services, consult the appropriate.Tn RFCfrom the Network Information Center..Pp.Nm Inetdrereads its configuration file when it receives a hangup signal,.Dv SIGHUP .Services may be added, deleted or modified when the configuration fileis reread..Nm Inetdcreates a file.Em /var/run/inetd.pidthat contains its process identifier..Sh SEE ALSO.Xr comsat 8 ,.Xr fingerd 8 ,.Xr ftpd 8 ,.Xr rexecd 8 ,.Xr rlogind 8 ,.Xr rshd 8 ,.Xr telnetd 8 ,.Xr tftpd 8.Sh HISTORYThe.Nmcommand appeared in.Bx 4.3 .Support for.Em Sun-RPC based services is modelled after thatprovided by.Em SunOS 4.1 .
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -