Xinetd的配置文件: /etc/xinetd.conf这是xinetd的真正的配置文件,它实现的总功能几乎都是在这里设置的。 /etc/xinetd.d/* 在这个目录下有各个小服务的单独的配置文件
1、 xinetd定制日志: (1)开启telnet服务以便测试: [root@localhost ~]# vi /etc/xinetd.d/krb5-telnet #开启telnet disable = no #找到这行将yes改为no,yes表示关闭 [root@localhost ~]# service xinetd restart #重启xinetd服务 [root@localhost ~]# netstat -utpln |grep 23 #检查23端口 tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 3597/xinetd
(2)调整日志存放的位置: [root@localhost ~]# telnet 192.168.8.31#在另外一台机器上telnet [root@localhost ~]# tail -1 /var/log/messages #查看系统默认的日志存放位置 Dec 19 01:02:30 localhost xinetd[3597]: START: telnet pid=3615 from=192.168.8.43 [root@localhost ~]# vi /etc/xinetd.conf #修改daemon为如下 log_type = SYSLOG local2 info [root@localhost ~]# vi /etc/syslog.conf#在日志配置文件添加如下行 local2.* /var/log/xinetd.log #定义日志存放目录 [root@localhost ~]# /etc/init.d/syslog restart #重启日志服务 [root@localhost ~]# /etc/init.d/xinetd restart #重启xinetd服务 [root@localhost ~]# telnet 192.168.8.31 #再次测试 [root@localhost ~]# tail /var/log/xinetd.log #查看新位置的日志 Dec 19 01:18:17 localhost xinetd[3752]: START: telnet pid=3754 from=192.168.8.43 这样日志就可以存放在其他位置了,很是方便管理。