Linux»·¾³ÏÂÅжϷþÎñÆ÷ÊÇ·ñÕý³£¹Ø»ú
Linux»·¾³ÏÂÅжϷþÎñÆ÷ÊÇ·ñÕý³£¹Ø»ú
2009-05-17 À´×Ô£ºZDNet ÊÕ²Ø
ϵͳÆô¶¯µÄʱºòÉú³ÉÒ»¸öÎļþ£¬Õý³£¹Ø»úµÄʱºòÔòɾ³ýÕâ¸öÎļþ£¬Ôò¿ÉÒÔ¸ù¾Ýϵͳ¿ª»úʱÓÐûÓÐÄǸöÎļþÀ´ÅжÏÊDz»ÊÇ·ÇÕý³£¹Ø»ú¡£
ϵͳÆô¶¯µÄʱºòÉú³ÉÒ»¸öÎļþ£¬Õý³£¹Ø»úµÄʱºòÔòɾ³ýÕâ¸öÎļþ£¬Ôò¿ÉÒÔ¸ù¾Ýϵͳ¿ª»úʱÓÐûÓÐÄǸöÎļþÀ´ÅжÏÊDz»ÊÇ·ÇÕý³£¹Ø»ú¡£
²½Ö裺
ÔÚ/etc/rc.d/init.d/ϱà³Ì½Å±¾¡£
ÅжÏÊÇ·ñÕý³£¹Ø»ú£¬ºÍÉú³ÉÎļþµÄ½Å±¾£ºtouch-file.sh
#!/bin/sh file=/tmp/check if [ -e $ ];then echo "this is not normal shutdown" >>/var/log/checkmessage else echo "this is normal shutdown and touch file" >>/var/log/checkmessage touch $ fi
Õý³£¹Ø»úɾ³ýÎļþµÄ½Å±¾£ºrm-file.sh
#!/bin/sh file=/tmp/check echo "this is normal shutdown and rm file" >>/var/log/checkmessage rm -rf $
Èýű¾×Ô¶¯Ö´ÐС£
ln -s /etc/rc.d/rc0.d/K01rm-file /etc/rc.d/init.d/rm-file.sh
×¢Ò⣺
#ll /etc/rc.d/rc0.d/
ÈíÁ¬½ÓÁ½±ßµÄÃû×Ö²»ÄÄÄظöÏàͬ£¬ºóÒ»¸ö¿ÉÒÔÓþø¶Ô·¾¶»òÊÇÏà¶Ô·¾¶£¬Ç§Íò±£Ö¤Á½±ßµÄÃû×Ö²»Ò»Ñù¡£
ln -s /etc/rc.d/rc6.d/K01rm-file /etc/rc.d/init.d/rm-file.sh ln -s /etc/rc.d/rc3.d/S01touch-file /etc/rc.d/init.d/touch-file.sh
ÎÒµÄϵͳûÓõ½x-window,ËùÒÔûÓÐlevel5£¬Ò²¾ÍÊDz»ÓÃÔÚ/etc/rc.d/rc5.d/Ï·Žű¾¡£
Ìرð×¢Ò⣺
K¿ªÍ·µÄ´ú±íϵͳ¹Ø±ÕµÄʱºòÖ´ÐУ¬S¿ªÍ·µÄ´ú±í¿ª»úµÄʱºòÖ´ÐС£×¢Òâ·þÎñÆ÷½Å±¾±àдµÄ¹æ·¶£¬ÒòΪÓÐK¿ªÍ¨µÄÈíÁ´½Ó²¢²»Ò»¶¨»áÔڹػúµÄʱºò×Ô¶¯È¥Ö´ÐУ¬ÕâÊÇΪʲôÄØ£¿Ö´ÐÐK½Å±¾µÄʱºò»á²éѯ/var/lock/subsys/ÏÂÊÇ·ñÓÐÓëK¿ªÍ·½Å±¾Í¬ÃûµÄ¿ÕÎļþÃû£¬Èç¹ûûÓоͲ»È¥Ö´ÐУ¬ËùÒÔÒª°´ÕÕ·þÎñÆ÷½Å±¾±àдµÄ¹æ·¶£¬Æô¶¯µÄʱºòÒªÔÚ/var/lock/subsys/ÏÈtouchÒ»¸öÓëK01ºóÃæͬÃûµÄ¿ÕÎļþ:
#/var/lock/subsys #touch fm-file
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
linuxÏÂÌṩtop¡¢psÃüÁî²é¿´µ±Ç°cpu¡¢memʹÓÃÇé¿ö£¬¼òÒª½éÉÜÈçÏ£º
Ò»¡¢Ê¹ÓÃps²é¿´½ø³ÌµÄ×ÊÔ´Õ¼ÓÃ
ps -aux²é¿´½ø³ÌÐÅϢʱ£¬µÚÈýÁоÍÊÇCPUÕ¼Óá£
[root@localhost utx86]# ps -aux | grep my_process
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 14415 3.4 ......
Îå¡¢ ipt_do_table()º¯Êý£¬Êý¾Ý°üµÄ¹ýÂË
5.1 ipt_entry Ïà¹Ø½á¹¹ ip_tables.h
ipt_entry½á¹¹Ç°ÃæÓйýÁË£¬ÔÙ¿´Ò»±é
struct ipt_entry
{
struct ipt_ip ip;
/* ËùҪƥÅäµÄ±¨ÎĵÄIPÍ·ÐÅÏ¢ */
unsigned int nfcache;
/* λÏòÁ¿£¬±êʾ±¾¹æÔò¹ØÐÄ ......
±¾ÎĽ²ÊöÁËLinuxÃüÁîÐб༿ì½Ý¼üµÄ·½·¨£¬Ï£Íû¶ÔÄúÓÐËù°ïÖú¡£
LinuxÃüÁîÐб༿ì½Ý¼ü£º
history ÏÔʾÃüÁîÀúÊ·Áбí
↑(Ctrl+p) ÏÔʾÉÏÒ»ÌõÃüÁî
↓(Ctrl+n) ÏÔʾÏÂÒ»ÌõÃüÁî
!num Ö´ÐÐÃüÁîÀúÊ·ÁбíµÄµÚnumÌõÃüÁî
!! Ö´ÐÐÉÏÒ»ÌõÃüÁî
!?string? Ö´Ðк¬ÓÐstring×Ö·û´®µÄ×îÐÂÃüÁî
Ctrl+r È»ºóÊäÈëÈô¸É×Ö· ......
ÔÎÄÍøÖ·£ºhttp://www.ibm.com/developerworks/cn/linux/l-rcu/
±¾ÎÄÏêϸµØ½éÉÜÁË Linux 2.6 ÄÚºËÖÐеÄËø»úÖÆ RCU(Read-Copy Update) µÄʵÏÖ»úÖÆ£¬Ê¹ÓÃÒªÇóÓëµäÐÍÓ¦Óá£
Ò»¡¢ ÒýÑÔ
ÖÚËùÖÜÖª£¬ÎªÁ˱£»¤¹²ÏíÊý¾Ý,ÐèҪһЩͬ²½»úÖÆ,Èç×ÔÐýËø(spinlock)£¬¶ÁдËø(rwlock)£¬ËüÃÇʹÓÃÆðÀ´·Ç³£¼òµ¥,¶øÇÒÊÇÒ»ÖÖºÜÓÐЧµÄͬ²½»úÖ ......