设为首页 加入收藏

TOP

18.4.2 Internet守护进程
2013-10-12 06:53:49 来源: 作者: 【 】 浏览:123
Tags:18.4.2 Internet 守护 进程

18.4.2  Internet守护进程

提供多项网络服务的Linux系统通常是以超级服务器的方式来运行的,由Internet守护进程inetd同时监听着许多端口地址上的连接。当有客户连接到某项服务时,inetd程序就会运行相应的服务器程序。这使服务器程序不必一直运行着;它们可以在必要时由inetd启动执行。下面是inetd配置文件"/etc/inetd.conf"中的一个片段,这个文件的作用是决定需要运行哪些个服务器。

  1. #  
  2. <service_name> <sock_type> <proto> <flags> <user> <server_path> <args> 
  3. #  
  4. # Echo, discard, daytime, and chargen are used primarily for testing.  
  5. #  
  6. daytime stream tcp nowait root internal  
  7. daytime dgram udp wait root internal  
  8. #  
  9. # These are standard services.  
  10. #  
  11. ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/wu.ftpd  
  12. telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd  
  13. #  
  14. # End of inetd.conf. 

连接daytime服务的操作实际是由inetd本身负责处理的,SOCK_STREAM(tcp)套接字和SOCK_DGRAM(udp)套接字都能使用这项服务。文件传输服务ftp只能通过SOCK_STREAM套接字提供,并且是由一个外部程序提供的。通过编辑该文件并将服务与某一程序相联系,就可以改变通过inetd提供的服务。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇18.3.6 接受连接 下一篇6.6 goto语句和标号

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: