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
相关文档:
1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI) 就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......
例一:发送Signaling Packet:
Signaling Command是2个Bluetooth实体之间的L2CAP层命令传输。所以得Signaling Command使用CID 0x0001.
多个Command可以在一个C-frame(control frame)中发送。
如果要直接发送Signaling Command.需要建立SOCK_RAW类型的L2CAP连接Socket。这样才有机会自己填充Command Code,Identi ......
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静态库和动态库的分析
2009-12-15 11:44
1.什么是库
在windows平台和linux平台下都大量存在着库。
本质上来说库是一种可执行代码的二进制形式,可以被操作系统载入内存执行。
由于windows和linux的本质不同,因此二者库的二进制是不兼容的。
本文仅限于介绍linux下的库 ......
买来的开发板一启动就进入Qtopia的界面,很像个手机,但我想让它开机就执行我的程序,怎么办呢?
在网上查找关于Linux启动的文章,发现这个文件配置了启动所做的操作:/etc/inittab.
# This is run first except when booting
::sysinit:/etc/init.d/rcS
# Start an "askfirst" shell on the console
# shell routin ......