Product SiteDocumentation Site

9.6. inetd スーパーサーバ

inetd (通常「インターネットスーパーサーバ」と呼ばれます) はサーバのサーバです。inetd は要求に応じてまれに使われるサーバを実行します。そうすれば、まれにしか使われないサーバを常に実行しておく必要がなくなります。
/etc/inetd.conf ファイルには、要求に応じて起動するサーバとサーバの使うポート番号が書かれています。inetd コマンドはここで書かれたすべてのポートをリッスンします。さらに、inetd はポートに対する接続を検出したら、対応するサーバプログラムを実行します。
/etc/inetd.conf ファイルの有効な各行は (空白で区切られた) 7 つのフィールドで 1 つのサーバを表現します。各フィールドの意味は以下の通りです。
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.