Linuxã®ãã¹ãç¨ã«ããã³ã°ã¢ããããããã¯ç¶æ ã«ããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ãä½ã£ã¦ã¿ã
ãã¹ãã®ããã«ãAWSã®Amazon Linuxã®ã¤ã³ã¹ã¿ã³ã¹ãã«ã¼ãã«ã¬ãã«ã§ãã³ã°ã¢ããããããã£ãã®ã§ããã¹ãç¨ã®ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ãä½ã£ã¦ã¿ã¾ããã
ã§ãããã¨
- ã«ã¼ãã«ã®ãã³ã°ã¢ãã(pingå¿çãã§ããªãã¬ãã«ãããªã¨ã³ãã·ã§ã³ãdisableã«ãã¦å®ç¾)
- ä¸éå端ãªãã³ã°ã¢ãã(pingå¿çã¯å¸°ãã¬ãã«ããªã¨ã³ãã·ã§ã³ã¯enable)
- ã«ã¼ãã«ãããã¯(echo c > /proc/sysrq-triggerã¨åã)
使ãæ¹
ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã®ãã«ã
ã³ã¼ãã¯GitHubã«ããã¾ãã
github.com
(1) å¿
è¦ãªããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«
ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã®ãã«ãã«ãgccã¨kernel-develãå¿
è¦ã«ãªãã¾ãã(Amazon Linuxã®å ´å)
sudo yum -y install git gcc kernel-devel
(2) ã½ã¼ã¹ã³ã¼ãããã¼ã«ã«ã«æã£ã¦ãã¾ã
git clone https://github.com/Noppy/HangAndPanicKernelModule.git cd HangAndPanicKernelModule/
(3)ãã«ããã¾ã
make ls *.ko hang_panic.ko
使ãæ¹
(1)ã¢ã¸ã¥ã¼ã«ã®ã¤ã³ã¹ãã¼ã«
sudo insmod hang_panic.ko lsmod |grep hang_panic
(2)使ãæ¹ã®ç¢ºèªæ¹æ³(è¦root権é)
cat /proc/hang_panic <<Hang&Panic module>> 'echo c > /proc/hang_panic' >>> panic 'echo h > /proc/hang_panic' >>> hang(disable local irq and preempt) 'echo H > /proc/hang_panic' >>> hang(disable only local irq)
(3)ãã³ã°ã¢ããããã(è¦root権é)
(a) Local IRQ 㨠preemptionãdisableã«ãã¦ãã³ã°(ãããããpingå¿çãã§ããªã)
echo h > /proc/hang_panic
(b) Local IRQã®ã¿disable(pingå¿çã¯ã§ããã¬ãã«)
echo H > /proc/hang_panic
(4)ãããã¯(è¦root権é)
# echo c > /proc/hang_panic
#è足
10å¹´åã®kernel2.6æ代ã¯ãã¸ã£ã¤ã¢ã³ãããã¯(BKL:Big Kernel Lockã¨ããã)ããã£ãã®ã§ããã£ã¨ç¶ºéºã«ãã³ã°ããããã¨ãã§ããã®ã§ãããã½ã¼ã¹ã³ã¼ãã®ä¸ãæ¢ããã®ã§ãããä»ã¯ã·ã¹ãã ã¯ã¤ããªããã¯ã®ã³ã¼ãããªããã§ããã»ã»ãRHEL3æ代ã«ãã客ããå
ã®ã·ã¹ãã ã§BKLã«è¦ãããããã®ããä»ã¯æã¨ãããã¨ãªãã§ããã