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¡£ÏÂÔØ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µÄ±àÒëȷʵ±ÈÒÔ ......
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" »ò " ......
×ܽ᣺1¡¢80X86ʹÓÃС¶Ë·¨£¬ÍøÂç×Ö½ÚÐòʹÓôó¶Ë·¨¡£
2¡¢¶þ½øÖƵÄÍøÂç±à³ÌÖУ¬´«ËÍÊý¾Ý£¬×îºÃÒÔunsigned char, unsigned short, unsigned int
À´´¦Àí£¬ unsign ......
Written by manio (http://blog.csdn.net/manio)
LinuxÄÚºËÊÇÒ»¸öÎޱȸ´ÔÓµÄϵͳ£¬ÒªÏë¿´Çå´óÖµÄÂöÂçÒ²·ÇÒ×Ê¡£Æäʵ£¬¿ÉÒÔ°ÑÔËÐÐÖеÄLinuxÏëÏñ³ÉÒ»¸öÈËÀàµÄÉç»á£¬µ±ÖеĽø³Ì¾ÍÊÇÉç»áÖеÄÈË¡£ÈËÓÐÉúÀϲ¡ËÀ£¬½ø³ÌÓд´½¨¡¢Òì³£¡¢ÖÕÖ¹¡£ÈËÓи÷ÖÖ¸÷ÑùµÄ²Æ²ú£¬½ø³ÌÓжÔÓ¦µÄµØÖ·¿Õ¼ä¡¢É豸µÈµÈ¡£È˱»¸÷ÖÖ¸÷ÑùµÄ¶«Î÷ÏÞÖÆ×Å£¬±»È˹ ......
ÂòÀ´µÄ¿ª·¢°åÒ»Æô¶¯¾Í½øÈëQtopiaµÄ½çÃ棬ºÜÏñ¸öÊÖ»ú£¬µ«ÎÒÏëÈÃËü¿ª»ú¾ÍÖ´ÐÐÎҵijÌÐò£¬Ôõô°ìÄØ£¿
ÔÚÍøÉϲéÕÒ¹ØÓÚLinuxÆô¶¯µÄÎÄÕ£¬·¢ÏÖÕâ¸öÎļþÅäÖÃÁËÆô¶¯Ëù×öµÄ²Ù×÷£º/etc/inittab.
# This is run first except when booting
::sysinit:/etc/init.d/rcS
# Start an "askfirst" shell on the console
# shell routin ......