linux½ø³Ìºǫ́ÔËÐеļ¸ÖÖ·½·¨
ÎÒÃǾ³£»áÅöµ½ÕâÑùµÄÎÊÌ⣬Óà telnet/ssh µÇ¼ÁËÔ¶³ÌµÄ Linux ·þÎñÆ÷£¬ÔËÐÐÁËһЩºÄʱ½Ï³¤µÄÈÎÎñ£¬ ½á¹ûÈ´ÓÉÓÚÍøÂçµÄ²»Îȶ¨µ¼ÖÂÈÎÎñÖÐ;ʧ°Ü¡£ÈçºÎÈÃÃüÁîÌá½»ºó²»Êܱ¾µØ¹Ø±ÕÖն˴°¿Ú/ÍøÂç¶Ï¿ªÁ¬½ÓµÄ¸ÉÈÅÄØ£¿ÏÂÃæ¾ÙÁËһЩÀý×Ó£¬ Äú¿ÉÒÔÕë¶Ô²»Í¬µÄ³¡¾°Ñ¡Ôñ²»Í¬µÄ·½Ê½À´´¦ÀíÕâ¸öÎÊÌâ¡£
nohup/setsid/&
³¡¾°£º
Èç¹ûÖ»ÊÇÁÙʱÓÐÒ»¸öÃüÁîÐèÒª³¤Ê±¼äÔËÐУ¬Ê²Ã´·½·¨ÄÜ×î¼ò±ãµÄ±£Ö¤ËüÔÚºǫ́Îȶ¨ÔËÐÐÄØ£¿
hangup Ãû³ÆµÄÀ´ÓÉ
ÔÚ Unix µÄÔçÆÚ°æ±¾ÖУ¬Ã¿¸öÖն˶¼»áͨ¹ý modem ºÍϵͳͨѶ¡£µ±Óû§ logout ʱ£¬modem ¾Í»á¹Ò¶Ï£¨hang up£©µç»°¡£ ͬÀí£¬µ± modem ¶Ï¿ªÁ¬½Óʱ£¬¾Í»á¸øÖն˷¢ËÍ hangup ÐźÅÀ´Í¨ÖªÆä¹Ø±ÕËùÓÐ×Ó½ø³Ì¡£
½â¾ö·½·¨£º
ÎÒÃÇÖªµÀ£¬µ±Óû§×¢Ïú£¨logout£©»òÕßÍøÂç¶Ï¿ªÊ±£¬Öն˻áÊÕµ½ HUP£¨hangup£©ÐźŴӶø¹Ø±ÕÆäËùÓÐ×Ó½ø³Ì¡£Òò´Ë£¬ÎÒÃǵĽâ¾ö°ì·¨¾ÍÓÐÁ½ÖÖ;¾¶£ºÒªÃ´Èýø³ÌºöÂÔ HUP Ðźţ¬ÒªÃ´Èýø³ÌÔËÐÐÔÚеĻỰÀï´Ó¶ø³ÉΪ²»ÊôÓÚ´ËÖն˵Ä×Ó½ø³Ì¡£
1. nohup
nohup ÎÞÒÉÊÇÎÒÃÇÊ×ÏÈÏëµ½µÄ°ì·¨¡£¹ËÃû˼Ò壬nohup µÄÓÃ;¾ÍÊÇÈÃÌá½»µÄÃüÁîºöÂÔ hangup Ðźš£ÈÃÎÒÃÇÏÈÀ´¿´Ò»Ï nohup µÄ°ïÖúÐÅÏ¢£º
NOHUP(1) User Commands NOHUP(1)
NAME
nohup - run a command immune to hangups, with output to a non-tty
SYNOPSIS
nohup COMMAND [ARG]...
nohup OPTION
DESCRIPTION
Run COMMAND, ignoring hangup signals.
--help display this help and exit
--version
output version information and exit
¿É¼û£¬nohup µÄʹÓÃÊÇÊ®·Ö·½±ãµÄ£¬Ö»ÐèÔÚÒª´¦ÀíµÄÃüÁîÇ°¼ÓÉÏ nohup ¼´¿É£¬±ê×¼Êä³öºÍ±ê×¼´íÎóȱʡ»á±»Öض¨Ïòµ½ nohup.out ÎļþÖС£Ò»°ãÎÒÃÇ¿ÉÔÚ½áβ¼ÓÉÏ"&"À´½«ÃüÁîͬʱ·ÅÈëºǫ́ÔËÐУ¬Ò²¿ÉÓÃ">filename 2>&1"À´¸ü¸ÄȱʡµÄÖض¨ÏòÎļþÃû¡£
nohup ʾÀý
[root@pvcent107 ~]# nohup ping www.ibm.com &
[1] 3059
nohup: appending output to `nohup.out'
[root@pvcent107 ~]# ps -ef |grep 3059
root 3059 984 0 21:06 pts/3 00:00:00 ping www.ibm.com
root 3067 984 0 21:06 pts/3 00:00:00 grep 3059
[root@pvcent107 ~]#
2¡£setsid
nohup ÎÞÒÉÄÜͨ¹ýºöÂÔ HUP ÐźÅÀ´Ê¹ÎÒÃǵĽø³Ì±ÜÃâÖÐ;±»Öжϣ¬µ«Èç¹ûÎÒÃÇ»»¸ö½Ç¶È˼¿¼£¬Èç¹ûÎÒÃǵĽø³Ì²»ÊôÓÚ½ÓÊÜ HUP ÐźŵÄÖն˵Ä×
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://blog.chinaunix.net/u/26185/showart_475934.html
ºÍÆäËûÄں˹¦ÄÜÒ»Ñù£¬Ã¿¸öÍøÂ繦Äܶ¼ÊÇÄں˳ÉÔ±ÖеÄÒ»¸ö¡£Òò´Ë£¬Ëü±ØÐëºÏÀíÇÒ¹«Æ½µÄʹÓÃÄÚ´æ,
CPUºÍÆäËû¹²Ïí×ÊÔ´¡£¾ø´ó¶àÊý¹¦Äܲ¢·ÇÄÚºËÖÐÒ»¶Î¶ÀÁ¢µÄ³ÌÐò£¬¶øÊǸù¾Ý¸Ã¹¦Äܶø»ò¶à»òÉÙµÄÓëÄÚºËÖÐÆäËû²¿·ÖÏ໥ӰÏì¡£Òò´ËËüÃÇ×ÜÊÇÊÔͼ£¬¾¡¿ÉÄܵģ¬Ê¹ÓÃ
ÀàËƵÄÌ ......
from: http://cc.byexamples.com/20070520/tap-the-interrupt-signal/
When you hit control+c, you are actually send a SIGINT ( Interrupt signal ) to your program. By default, your program will be terminated after receiving SIGINT. But you can change the way of handling Interrupt signal.
Some of the a ......
ÏÂÔØÐÂÄÚºËÒÔºó£¬ÏÈ°ÑLinux-2.6.18.2.tar.bz2 ¸´ÖƵ½/usr/src/ µÄÏÂÃæ
tar –jxvf Linux-2.6.18.2.tar.bz2 cd Linux-2.6.18.2 make mrproper °ÑÔÀ´±àÒë²úÉúµÄÀ¬»øɾ³ý
ÅäÖÃÄں˿ÉÒÔ¸ù¾ÝÐèÒªÓë°®ºÃʹÓÃÏÂÃæÃüÁîÖеÄÒ»¸ö£º
££make config £¨»ùÓÚÎı¾µÄ×îΪ´«Í³µÄÅäÖýçÃ棩
££make menuconfig £¨»ùÓÚÎı¾ ......
ÎÒÃÇͨ³£°ÑһЩ¹«Óú¯ÊýÖÆ×÷³Éº¯Êý¿â£¬¹©ÆäËü³ÌÐòʹÓá£
º¯Êý¿â·ÖΪ¾²Ì¬¿âºÍ¶¯Ì¬¿âÁ½ÖÖ¡£
¾²Ì¬¿âÔÚ³ÌÐò±àÒëʱ»á±»Á¬½Óµ½Ä¿±ê´úÂëÖУ¬³ÌÐòÔËÐÐʱ½«²»ÔÙÐèÒª¸Ã¾²Ì¬¿â¡£
¶¯Ì¬¿âÔÚ³ÌÐò±àÒëʱ²¢²»»á±»Á¬½Óµ½Ä¿±ê´úÂëÖУ¬¶øÊÇÔÚ³ÌÐòÔËÐÐÊDzű»ÔØÈ룬Òò´ËÔÚ³ÌÐòÔËÐÐʱ»¹ÐèÒª¶¯Ì¬¿â´æÔÚ¡£
±¾ÎÄÖ÷Ҫͨ¹ý¾ÙÀýÀ´ËµÃ÷ÔÚLinuxÖÐÈçº ......
sarÊÇÒ»¸öÓÅÐãµÄÒ»°ãÐÔÄܼàÊÓ¹¤¾ß£¬Ëü¿ÉÒÔÊä³öLinuxËùÍê³ÉµÄ¼¸ºõËùÓй¤×÷µÄÊý¾Ý¡£sarÃüÁîÔÚsysetat rpmÖÐÌṩ¡£Ê¾ÀýÖÐʹÓÃsysstat°æ±¾5.0.5£¬ÕâÊÇÎȶ¨µÄ×îа汾֮һ¡£¹ØÓÚ°æ±¾ºÍÏÂÔØÐÅÏ¢£¬Çë·ÃÎÊsysstatÖ÷Ò³http://perso.wanadoo.fr/sebastien.godard/¡£
sar¿ÉÒÔÏÔʾCPU¡¢ÔËÐжÓÁС¢´ÅÅÌI/O¡¢·ÖÒ³£¨½»»»Çø£©¡¢ÄÚ´æ¡¢CPUÖÐ ......