Super server inetd
时间:2007-02-05 来源:gadfly0217
超级服务器 inetd
某种守护进程用sockets来代替services,并同时监听他们。当任何一个sockets上有连接时,inetd接受连接,产生对应这个端口的服务,产生子进程来管理服务。父进程返回继续监听。
最常用的超级服务器是inetd (Internet Daemon),配置文件是/etc/inetd.conf
文件中格式如下:
Service type protocol wait user server cmdline
Service:服务名,通过/etc/services转换为端口号。
Type: stream ,dgram. TCP用stream ,UDP用dgram.
Protocol:应用的协议。
Wait:wait对应单线程服务器,nowait对应多线程服务器,stream sockets一般使用nowait。
User:用户的登陆ID。
Server:服务器程序的全名。
例子:
#
# inetd services
ftp stream tcp nowait root /usr/sbin/ftpd in.ftpd -l
telnet stream tcp nowait root /usr/sbin/telnetd in.telnetd -b/etc/issue
#finger stream tcp nowait bin /usr/sbin/fingerd in.fingerd
#tftp dgram udp wait nobody /usr/sbin/tftpd in.tftpd
#tftp dgram udp wait nobody /usr/sbin/tftpd in.tftpd /boot/diskless
#login stream tcp nowait root /usr/sbin/rlogind in.rlogind
#shell stream tcp nowait root /usr/sbin/rshd in.rshd
#exec stream tcp nowait root /usr/sbin/rexecd in.rexecd
#
# inetd internal services
#
daytime stream tcp nowait root internal
daytime dgram udp nowait root internal
time stream tcp nowait root internal
time dgram udp nowait root internal
echo stream tcp nowait root internal
echo dgram udp nowait root internal
discard stream tcp nowait root internal
discard dgram udp nowait root internal
chargen stream tcp nowait root internal
chargen dgram udp nowait root internal
相关阅读 更多 +