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 ÊäÈëºÍÊä³ö£º
ʹÓá¡£ã±àдµÄÒ»¸öÀý×Ó£º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µÈÐÒé ......
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâÆª·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´Ë×ªÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨ÕâÆª²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
ÔÚ UNIX ϵͳÖУ¬Óû§´´½¨Ò»¸öнø³ÌµÄΨһ·½·¨¾ÍÊǵ÷ÓÃϵͳµ÷Óà fork¡£µ÷ Óà fork µÄ½ø³Ì³ÆÎª¸¸½ø³Ì£¬¶øÐ´´½¨µÄ½ø³Ì½Ð×ö×Ó½ø³Ì¡£ÏµÍ³µ÷ÓõÄÓï·¨¸ñʽ£º
pid = fork();
ÔÚ´Óϵͳµ÷Óà fork Öзµ»ØÊ±£¬Á½¸ö½ø³Ì³ýÁË·µ»ØÖµ pid ²»Í¬Í⣬¾ßÓÐÍêȫһÑùµÄÓû§¼¶ÉÏÏÂÎ ......
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 ......