IT|維運管理|作業系統|Linux|Watchdog 確保 Raspberry Pi(樹莓派) 高可用性
Watchdog 確保 Linux 高可用性 http://purplegrape.blog.51cto.com/1330104/1131910 Watchdog 確保 Raspberry Pi(樹莓派) 高可用性 造成 Raspberry Pi 當掉的原因有很多,比如電源供電不足、電源線阻抗 太大,造成提供的電壓不夠、有零件故障、瑕疵品……等,當然也有可能是 Raspberry Pi 在台灣水土不服所導致,有興趣的話使用 Raspberry Pi freeze 這樣的關鍵字去收尋,就可找到非常多的討論串。 那既然手邊的 Raspberry Pi 會當掉,那要怎辦呢?總不能一旦他掛掉,就手動 重新啟動吧? 這時候就是 watchdog 出馬的時候啦 ~ Watchdog,中文譯為 看門狗 ,這是一種用於判斷系統是否有正常運作的程式,每 隔固定的間隔就會運作,若系統異常,則重啟系統。 Raspberry Pi 使用的 BCM2708 內建有硬體版的 watchdog 模組,我們可以透 過 Linux Kernel 的 bcm2708_wdog 模組來控制 Raspberry Pi 的 watchdog, 達到當機後進行重新開機的功能。 開機後自動載入 watchdog 模組 要啟用 watchdog 功能,首先要記得載入相對應的 kernel module,因此我們編 輯 /etc/modules ,並將裡面內容修改成如下 # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. # Parameters can be specified after the module name. snd-bcm2835 bcm2708_wdog 當然如果希望馬上就啟用 watchdog,而不是等到下次重開機後才有用的話,則要 ...