易截截图软件、单文件、免安装、纯绿色、仅160KB

linux 使用xinetd

参考:
Linux下syslog日志函数使用 :http://blog.csdn.net/telehiker/archive/2007/10/18/1830575.aspx
xinetd 使用指南中文:http://www.dbanotes.net/OpenSource/Using_xinetd.html
xinetd 官网: http://www.xinetd.org
xinetd 跟服务通信使用 stdin/stderr 输入和输出:
使用 c编写的一个例子:helloword.c
#include <stdio.h>
#include <syslog.h>
#define MAX_INPUT 256
int main(void)
{
char input[MAX_INPUT+1] ;
if ( fgets(input, MAX_INPUT, stdin) != NULL ) {
//printf ("%s",input);
syslog(LOG_INFO,"hel - %s\n",input);
fprintf (stdout,input);
}
return 0;
}
1.编译后放在/usr/bin/helloword
 2.编写配置文件:nano -w /etc/xinetd.d/helloword
service helloword
{
disable = no
wait = no
socket_type = stream
flags = IPv6
port = 3000
user = root
group = root
server = /usr/bin/helloword
#server_args =
}

3.配置服务器上使用的端口:
  nano -w /etc/services 增加2行:
  helloc          3000/tcp
  helloc          3000/udp
4.重新启动xinetd ,是服务生效。
5.配置日志:nano -w /etc/metalog :
  Xinetd :
  program_regex = "^xinetd"
  program_regex = "^helloword"
  logdir   = "/var/log/xinetd"
  break    = 1
 
6.测试:
  tg flashpolicyd_v0.6 # perl -e 'printf "hello\n",0' | nc 127.0.0.1 3000
  hello
作者:Jose Nazario
译者:Fenng
日期:25-Oct-2004
出处:http://www.dbanotes.net
版本:@2001/11/27 Version 0.01 @2003/05/23 Version 1.00
Jose描述了如何着手配置调整xinetd。
xinetd取代了inetd,并且提供了访问控制、加强的日志和资源管理功能。xinetd已经成为Red Hat 7 和 Mandrake 7.2的Internet标准超级守护进程。这篇文章将引导你如何应用一些它的特性,这些特性基于xinetd 2.1.8.8 pre3版本。
导言
xinetd的最初的作者(Pan


相关文档:

实战Linux Bluetooth编程(三) HCI层编程

1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI)  就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......

实战Linux Bluetooth编程 (七) SDP协议

Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......

Linux下安装jdk&tomcat

1.下载jdk-6u2-linux-i586-rpm.bin
2. 在当前目录输入
sh jdk-6u2-linux-i586-rpm.bin
3.看到 安装程序在询问您是否尊守许可协议页面 ,回车,空格都可以,看完协议.
出现一行字:Do you aggree to the above license terms? [yes or no]
安装程序在问您是否愿意遵守刚才看过的许可协议。当然要同意了,输入"y" 或 " ......

linux 字符集转换教训

linux下的字符集转换命令是iconv,我们都知道从utf8编码转换成gbk编码可以这么做:
iconv -f utf8 -t gbk aaa.dat > bbb.dat
但是,今天遇到一个问题发现对于同样的文件,不同的机器上有的能转有的不能转,很是困惑。最后发现,原来是操作系统的问题,一台是redhat,一台是solaris。在同一个操作系统上从gbk--utf8--gb ......

Make Linux Resources


 
  Resources on the site
• Interactive map of GNU/Linux OS and FOSS
• "GNU/Linux is my home" - map of GNU/Linux system
• Interactive map of Linux kernel
• Linux inside
• Linux Technology Reference (single page view)
• Linux kernel diagram
• Li ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号