易截截图软件、单文件、免安装、纯绿色、仅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内核升级步骤

1。下载2.6.9的内核
2。在/usr/src目录下解压内核
tar zvxf /下载的路径/linux-2.6.0.tar.gz
 
3。配置
# make mrproper
# make menuconfig
make mrproper 是清理代码树的动作,保证源代码是干净的
4.编译
make
5。安装
make modules_install
make install
 
看来2。6的编译确实比以 ......

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常用命令(基础)
1. man 对你熟悉或不熟悉的命令提供帮助解释
eg:man ls 就可以查看ls相关的用法
注:按q键或者ctrl+c退出,在linux下可以使用ctrl+c终止当前程序运行。
2. ls 查看目录或者文件的属*,列举出任一目录下面的文件
eg: ls /usr/man
ls -l
a.d表示目录(directory),如果是一个"-"表示是文件,如果 ......

嵌入式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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号