linuxÏÂɱ×Ó½ø³Ì£¨µ÷ÓÃkill£©
ÔÚlinuxÀïÃ棬fork()Ò»¸ö×Ó½ø³Ì£¬½á¹ûÔõô¶¼É±²»µô¡£ÓÉÓÚ²»ÊÇrootÓû§£¬Ê¹ÓÃkill -9 pid£¬Ò²Ã»Óá£
ÔÚps -awtµÄʱºò×ÜÊÇÄÜ¿´µ½ÄǸö×Ó½ø³Ì¡£ÎÒÔÚ×Ó½ø³ÌÀïÃæÆðÁ˸öshell¡£
ºóÀ´googleÁËһϣ¬·¢ÏÖÒªµ÷ÓÃwaitpid²Å¿ÉÒÔ¡£
Õâ¸öÊÇËùνµÄzombie£¨½©Ê¬½ø³Ì£©
ÒýÓÃÒ»¶Î£º
ÔÚfork()/execve()¹ý³ÌÖУ¬¼ÙÉè×Ó½ø³Ì½áÊøʱ¸¸½ø³ÌÈÔ´æÔÚ£¬¶ø¸¸½ø³Ìfork()֮ǰ¼Èû°²×°SIGCHLDÐźŴ¦Àíº¯Êýµ÷ÓÃwaitpid()µÈ´ý×Ó½ø³Ì½áÊø£¬ÓÖûÓÐÏÔʽºöÂÔ¸ÃÐźţ¬Ôò×Ó½ø³Ì³ÉΪ½©Ê¬½ø³Ì£¬ÎÞ·¨Õý³£½áÊø£¬´Ëʱ¼´Ê¹ÊÇrootÉí·Ýkill -9Ò²²»ÄÜɱËÀ½©Ê¬½ø³Ì¡£²¹¾È°ì·¨ÊÇɱËÀ½©Ê¬½ø³ÌµÄ¸¸½ø³Ì(½©Ê¬½ø³ÌµÄ¸¸½ø³Ì±ØÈ»´æÔÚ)£¬½©Ê¬½ø³Ì³ÉΪ"¹Â¶ù½ø³Ì"£¬¹ý¼Ì¸ø1ºÅ½ø³Ìinit£¬initʼÖջḺÔðÇåÀí½©Ê¬½ø³Ì¡£
¡¡¡¡½©Ê¬½ø³ÌÊÇÖ¸µÄ¸¸½ø³ÌÒѾÍ˳ö,¶ø¸Ã½ø³ÌdeadÖ®ºóûÓнø³Ì½ÓÊÜ,¾Í³ÉΪ½©Ê¬½ø³Ì.(zombie)½ø³Ì
¸½²âÊÔ´úÂ룺
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <signal.h>
int main( void )
{
FILE *stream;
FILE *wstream;
char buf[1024],buf1[1024];
int i,j,pid;
memset( buf, '\0', sizeof(buf) );//³õʼ»¯buf,ÒÔÃâºóÃæдÈçÂÒÂëµ½ÎļþÖÐ
pid = fork();
if(pid>0)
{
printf("parant start!%d\n",pid);
sleep(2);
//sprintf(buf,"kill -9 %d\n",pid);
if (j = kill(pid,SIGTERM) < 0)//SIGKILL
printf("parent system failed!\n");
else
printf("system:%s\n,result:%d\n",buf,j);
printf("parant end!\n");
pid=wait(NULL);
printf("I catched a child process with pid of %d\n",pid);
&nb
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
ÔÚÉÏһƪ²©ÎÄÀÎÒÃÇÒѾ¿´µ½LinuxÈçºÎÓÐЧµØÀûÓÃ80x86µÄ·Ö¶ÎºÍ·ÖÒ³Ó²¼þµ¥Ôª°ÑÂß¼µØַת»»ÎªÏßÐÔµØÖ·£¬ÔÚÓÉÏßÐÔµØַת»»µ½ÎïÀíµØÖ·¡£ÄÇôÎÒÃǵÄÓ¦ÓóÌÐòÈçºÎʹÓÃÕâЩÂß¼µØÖ·£¬Õû¸öÄÚ´æµÄµØÖ·²¼¾ÖÓÖÊÇÔõÑùµÄ£¿´òÒ»¸ö±È·½£¬ÄÚ´æ¾ÍÏñÒ»×ù³ÇÊУ¬¶ø¾ÓסÔÚÕâ¸ö³ÇÊÐÀïµÄÊÐÃñ¾ÍÏñÊǸ÷¸ö½ø³Ì£¬Ò»¸öÊÐÃñ³ÔºÈÀÈö˯£¬µ±È»¾ÍµÃÓÃÓÚ&l ......
ÓÃApacheÅäÖÃÐéÄâÖ÷»ú
apache²»½öÖ§³Ö»ùÓÚÓòÃûµÄÐéÄâÖ÷»ú£¬»¹Ö§³Ö»ùÓÚIPµÄÐéÄâÖ÷»ú£¬Ã¿Ò»¸öapacheÐéÄâÖ÷»ú¶¼Óе¥¶ÀµÄÅäÖÃÎļþÔÚ/etc/apache2/sites-availableÖУ¬defaultÊÇĬÈϵÄÐéÄâÖ÷»ú£¬Õâ¸öÐéÄâÖ÷»úÔÚ°²×°Ê±ÒѾ±»Á´½Óµ½ /etc/apache2/sites-enabled Ŀ¼Ï£¬ÔÚä¯ÀÀÆ÷ÖзÃÎÊ·þÎñÆ÷IPµØÖ·£¬½«»á³öÏÖ “It Works&rd ......
-------------
¡¡¡¡ÎĵµÄ¿Â¼
¡¡¡¡-------------
¡¡¡¡1 ʲôÊÇsyslogd
¡¡¡¡2 ÅäÖÃsyslogdµÄ˵Ã÷
¡¡¡¡3 syslogdºÍϵͳÖзþÎñÅäÖÃÖÐÈÕÖ¾µÄ¹Øϵ
¡¡¡¡4 ʲôÊÇlogrotate
¡¡¡¡5 ÅäÖÃlogrotateµÄ˵Ã÷
¡¡¡¡-------------
¡¡¡¡ÎĵµÕýÎÄ
¡¡¡¡-------------
¡¡¡¡1 ʲôÊÇsyslogd
¡¡¡¡syslogd¿ÉÒÔ¼òµ¥µØ±»³ÆΪ¼Ç¼ϵͳ»î¶¯µ ......