闲来看着一个inetd服务的使用方法,呵呵,没事儿在linux测一下,还真有点儿用处,要是做监控什么的可以省得自己写代码做个东西了
[root@logser ~]#
[root@logser ~]# more /etc/services |grep macer
macer 7777/tcp
[root@logser ~]# more /etc/xinetd.d/macer
# default: on
# description: The finger server answers finger requests. Finger is \
# a protocol that allows remote users to see information such \
# as login name and last login time for local users.
service macer
{
socket_type = stream
wait = no
user = nobody
server = /macer
disable = no
}
[root@logser ~]# more /macer
#! /bin/bash
echo "I Love you,you are welecom"
who
[root@logser ~]# telnet 127.0.0.1 7777
Trying 127.0.0.1...
Connected to logser.monitor.com (127.0.0.1).
Escape character is '^]'.
I Love you,you are welecom
root tty1 Feb 25 12:45
root pts/0 Feb 25 13:15 (192.168.1.102)
Connection closed by foreign host.
[root@logser ~]# uname -a
Linux logser.monitor.com 2.6.9-22.EL #1 Mon Sep 19 18:20:28 EDT 2005 i686 i686 i386 GNU/Linux
[root@logser ~]#
阅读(649) | 评论(0) | 转发(0) |