xinetd 中文man頁面
NAME
xinetd - 擴展的互聯(lián)網(wǎng)服務(wù)守護進(jìn)程
總覽 SYNOPSIS
xinetd [options]
描述 DESCRIPTION
xinetd 執(zhí)行與 inetd 相同的任務(wù):它啟動提供互聯(lián)網(wǎng)服務(wù)的程序。與在系統(tǒng)初始化時啟動這些服務(wù)器,讓它們保持休眠,直到有連接請求到達(dá)才提供服務(wù)這種做法不同, fBxinetd 是唯一的被啟動的守護進(jìn)程,它偵聽各種服務(wù)在它們各自的配置文件中列出的所有端口。當(dāng)一個請求到達(dá),xinetd 啟動合適的服務(wù)器。因為它以這種方式操作,xinetd (還有 inetd) 常被稱作超級服務(wù)器。
列在 xinetd 的配置文件中的服務(wù)可以分為兩組。第一組的服務(wù)稱為 多線程的 (multi-threaded) 并且它們需要為每個新的連接請求產(chǎn)生 (fork) 一個新的服務(wù)器進(jìn)程。接下來新的服務(wù)器將處理那個連接。對于這些服務(wù),xinetd 保持偵聽新的請求從而可以孵化 (spawn) 新的服務(wù)器。另一方面,第二組包含著需要由服務(wù)器守護進(jìn)程處理所有新的連接請求的服務(wù)。這些服務(wù)稱為 單線程的 (single-threaded) 并且 xinetd 將停止為它們處理新的請求,直到這個服務(wù)器退出。這個組中的服務(wù)一般都是基于數(shù)據(jù)報的。
至今,超級服務(wù)器存在的唯一理由是通過避免大量產(chǎn)生生命周期中大部分時間可能都是空閑著的進(jìn)程,從而節(jié)省系統(tǒng)資源。當(dāng)實現(xiàn)這種功能時, fBxinetd 從超級服務(wù)器這種思想中獲得了好處,可以提供訪問控制和日志等特性。更進(jìn)一步,xinetd 不僅限于偵聽 /etc/services 中列出的服務(wù)。因此,任何人都可以使用 xinetd 來啟動特殊用途的服務(wù)器。
選項 OPTIONS
- -d
- 啟用調(diào)試模式。這樣將產(chǎn)生大量調(diào)試輸出,并且使得在 xinetd 上使用一個調(diào)試器成為可能。
- -syslog syslog_facility
- 這個選項使得 syslog 使用指定的日志功能來記錄 xinetd 產(chǎn)生的消息??梢允褂孟铝泄δ埽?daemon, auth, user, local[0-7] (參見 syslog.conf(5) 來查看它們的意義)。這個選項在 debug 模式是無效的,因為所有的相關(guān)信息都將送到終端上。
- -filelog logfile
- xinetd 產(chǎn)生的信息將放到指定文件中。信息總是添加到文件之后。如果文件不存在,將會被創(chuàng)建。這個選項在 debug 模式無效,因為所有的相關(guān)信息都將送到終端上。
- -f config_file
- 決定xinetd 用來配置的文件。默認(rèn)設(shè)置是 /etc/xinetd.conf。
- -pidfile pid_file
進(jìn)程 ID 被寫入的文件。這個選項在 debug 模式無效。- -dontfork
- 指定xinetd 在前臺運行,而不是分離自身以支持由 init 或 daemontools 運行。這個選項自動設(shè)置了 -stayalive (參見下面)。
- -stayalive
- 指定xinetd 保持運行,即使沒有指定服務(wù)。
- -limit proc_limit
- 這個選項為 xinetd 可以啟動的并行運行的進(jìn)程數(shù)設(shè)置了一個上限。目的是防止進(jìn)程表溢出。
- -logprocs limit
- 這個選項為服務(wù)遠(yuǎn)程用戶的并行運行的進(jìn)程數(shù)設(shè)置了一個上限。
- -version
- 這個選項使得 xinetd 打印出它的版本信息。
- -inetd_compat
- 這個選項使得 xinetd 在標(biāo)準(zhǔn)的配置文件之外,附加地讀取/etc/inetd.conf。/etc/inetd.conf 的讀取是在讀取標(biāo)準(zhǔn)的配置文件之后。
- -cc interval
- 這個選項指定 xinetd 每 interval 秒對內(nèi)部狀態(tài)進(jìn)行一次定時的一致性檢查。
syslog 和 filelog 選項是互相獨立的。如果沒有指定任何一個,默認(rèn)將使用 syslog 的 daemon 功能。你不應(yīng)將 xinetd 信息與和服務(wù)日志相關(guān)的信息相混淆。后者只有在配置文件中指定之后才會記錄。
控制 xinetd CONTROLLING XINETD
xinetd 收到一定的信號時會執(zhí)行一定的動作。與特定信號相關(guān)聯(lián)的特定動作可以通過修改 config.h 并且重新編譯來重新定義。
- SIGHUP
- 導(dǎo)致一個強制的重新配置,意味著 xinetd 重新讀取配置文件,停止不再有效的服務(wù)的服務(wù)器。在正在運行的服務(wù)器上將刷新訪問控制,檢查遠(yuǎn)程位置,訪問時間和服務(wù)器實例。如果允許的服務(wù)器實例數(shù)減少了,一些隨機選取的服務(wù)器將會被殺掉來滿足限制; 這將在任何服務(wù)器停止之后發(fā)生,因為不能通過遠(yuǎn)程位置或訪問時間的檢查(this will happen after any servers are terminated because of failing the remote location or access time checks)。還有,如果 INTERCEPT 標(biāo)志被清除后又重新設(shè)置,此服務(wù)的任何運行中的服務(wù)器將被停止。這樣做的目的是保證在強制的重新配置之后,沒有那種接受從不遵循訪問控制標(biāo)準(zhǔn)的地址發(fā)來的包的服務(wù)器在運行。 SIGQUIT
- 導(dǎo)致程序退出。
- SIGTERM
- 在 xinetd 退出之前,停止所有運行中的服務(wù)器。
- SIGUSR1
- 導(dǎo)致內(nèi)部狀態(tài)轉(zhuǎn)儲 (默認(rèn)的轉(zhuǎn)儲文件是 /var/run/xinetd.dump;要改變文件名,修改 config.h 然后重新編譯。)
- SIGIOT
- 導(dǎo)致一個內(nèi)部一致性檢查來核對程序使用的數(shù)據(jù)結(jié)構(gòu)沒有崩潰。當(dāng)檢查結(jié)束時, xinetd 將產(chǎn)生一個消息,報告測試是成功了還是失敗了。
重新配置的時候,日志文件被關(guān)閉又重新打開。這樣做允許移除舊的日志文件。
文件 FILES
- /etc/xinetd.conf
- 默認(rèn)的配置文件
- /var/run/xinetd.dump
- 默認(rèn)的轉(zhuǎn)儲文件
參見 SEE ALSO
inetd(8),
xinetd.conf(5),
xinetd.log(5)
http://cr.yp.to/daemontools.html
#p#
NAME
xinetd - the extended Internet services daemon
SYNOPSIS
xinetd [options]
DESCRIPTION
xinetd performs the same function as inetd: it starts programs that provide Internet services. Instead of having such servers started at system initialization time, and be dormant until a connection request arrives, xinetd is the only daemon process started and it listens on all service ports for the services listed in its configuration file. When a request comes in, xinetd starts the appropriate server. Because of the way it operates, xinetd (as well as inetd) is also referred to as a super-server.
The services listed in xinetd's configuration file can be separated into two groups. Services in the first group are called multi-threaded and they require the forking of a new server process for each new connection request. The new server then handles that connection. For such services, xinetd keeps listening for new requests so that it can spawn new servers. On the other hand, the second group includes services for which the service daemon is responsible for handling all new connection requests. Such services are called single-threaded and xinetd will stop handling new requests for them until the server dies. Services in this group are usually datagram-based.
So far, the only reason for the existence of a super-server was to conserve system resources by avoiding to fork a lot of processes which might be dormant for most of their lifetime. While fulfilling this function, xinetd takes advantage of the idea of a super-server to provide features such as access control and logging. Furthermore, xinetd is not limited to services listed in /etc/services. Therefore, anybody can use xinetd to start special-purpose servers.
OPTIONS
- -d
- Enables debug mode. This produces a lot of debugging output, and it makes it possible to use a debugger on xinetd.
- -syslog syslog_facility
- This option enables syslog logging of xinetd-produced messages using the specified syslog facility. The following facility names are supported: daemon, auth, user, local[0-7] (check syslog.conf(5) for their meanings). This option is ineffective in debug mode since all relevant messages are sent to the terminal.
- -filelog logfile
- xinetd-produced messages will be placed in the specified file. Messages are always appended to the file. If the file does not exist, it will be created. This option is ineffective in debug mode since all relevant messages are sent to the terminal.
- -f config_file
- Determines the file that xinetd uses for configuration. The default is /etc/xinetd.conf.
- -pidfile pid_file
The process ID is written to the file. This option is ineffective in debug mode.- -dontfork
- Tells xinetd to stay in the foreground rather than detaching itself, to support being run from init or daemontools. This option automatically sets -stayalive (see below).
- -stayalive
- Tells xinetd to stay running even if no services are specified.
- -limit proc_limit
- This option places a limit on the number of concurrently running processes that can be started by xinetd. Its purpose is to prevent process table overflows.
- -logprocs limit
- This option places a limit on the number of concurrently running servers for remote userid acquisition.
- -version
- This option causes xinetd to print out its version information.
- -inetd_compat
- This option causes xinetd to read /etc/inetd.conf in addition to the standard xinetd config files. /etc/inetd.conf is read after the standard xinetd config files.
- -cc interval
- This option instructs xinetd to perform periodic consistency checks on its internal state every interval seconds.
The syslog and filelog options are mutually exclusive. If none is specified, the default is syslog using the daemon facility. You should not confuse xinetd messages with messages related to service logging. The latter are logged only if this is specified via the configuration file.
CONTROLLING XINETD
xinetd performs certain actions when it receives certain signals. The actions associated with the specific signals can be redefined by editing config.h and recompiling.
- SIGHUP
- causes a hard reconfiguration, which means that xinetd re-reads the configuration file and terminates the servers for services that are no longer available. Access control is performed again on running servers by checking the remote location, access times and server instances. If the number of server instances is lowered, some arbitrarily picked servers will be killed to satisfy the limit; this will happen after any servers are terminated because of failing the remote location or access time checks. Also, if the INTERCEPT flag was clear and is set, any running servers for that service will be terminated; the purpose of this is to ensure that after a hard reconfiguration there will be no running servers that can accept packets from addresses that do not meet the access control criteria.
- SIGQUIT
- causes program termination.
- SIGTERM
- terminates all running servers before terminating xinetd.
- SIGUSR1
- causes an internal state dump (the default dump file is /var/run/xinetd.dump; to change the filename, edit config.h and recompile).
- SIGIOT
- causes an internal consistency check to verify that the data structures used by the program have not been corrupted. When the check is completed xinetd will generate a message that says if the check was successful or not.
On reconfiguration the log files are closed and reopened. This allows removal of old log files.
FILES
- /etc/xinetd.conf
- default configuration file
- /var/run/xinetd.dump
- default dump file
SEE ALSO
inetd(8),
xinetd.conf(5),
xinetd.log(5)
http://cr.yp.to/daemontools.html