Product SiteDocumentation Site

9.6. inetd 超级服务器

Inetd(常被称为“网络超级服务”)是一个服务器服务。它按需求运行一些不常用的服务,而且不需要连续运行。
/etc/inetd.conf 文件列出服务器及其通用的端口号。inetd 命令侦测它们;若发现任何端口号已被链接,则运行对应的程序。
/etc/inetd.conf 文件中的每列条目以 7 个字段 (以空格区分) 描述服务器:
The following example illustrates some use-cases after installing talkd, nullidentd (ident-server), and fingerd:

例 9.1. 摘自 /etc/inetd.conf

#:BSD: Shell, login, exec and talk are BSD protocols.
talk   dgram   udp     wait    nobody.tty   /usr/sbin/in.talkd      in.talkd
ntalk  dgram   udp     wait    nobody.tty   /usr/sbin/in.ntalkd     in.ntalkd

#:INFO: Info services
ident  stream  tcp     nowait  nobody       /usr/sbin/nullidentd    nullidentd
finger stream  tcp     nowait  nobody       /usr/sbin/tcpd          /usr/sbin/in.fingerd
The tcpd program is frequently used in the /etc/inetd.conf file. It allows limiting incoming connections by applying access control rules, documented in the hosts_access(5) manual page, and which are configured in the /etc/hosts.allow and /etc/hosts.deny files. Once it has been determined that the connection is authorized, tcpd executes the real server (like in.fingerd in our example). It is worth noting that tcpd relies on the name under which it was invoked (that is the first argument, argv[0]) to identify the real program to run. So you should not start the arguments list with tcpd but with the program that must be wrapped.