Linux 內建的 watchdog 的簡介

來源:互聯網
上載者:User
Linux 內建了一個 watchdog 的實現,用於監視系統的運行,包括一個核心 watchdog module 和一個使用者空間的 watchdog 程式

核心 watchdog 模組:

核心 watchdog 模組通過 /dev/watchdog 這個字元裝置與使用者空間通訊。使用者空間程式一旦開啟 /dev/watchdog 裝置,就會導致在核心中啟動一個 1分鐘的定時器,此後,使用者空間程式需要保證在 1分鐘之內向這個裝置寫入資料,每次寫操作會導致重新設定定時器。如果使用者空間程式在 1分鐘之內沒有寫操作,定時器到期會導致一次系統 reboot 操作。

使用者空間程式可通過關閉 /dev/watchdog 來停止核心中的定時器。

使用者空間的 watchdog 守護進程:

在使用者空間,還有一個叫做 watchdog 的守護進程,它可以定期對系統進行檢測,包括:

  • Is the process table full?
  • Is there enough free memory?
  • Are some files accessible?
  • Have some files changed within a given interval?
  • Is the average work load too high?
  • Has a file table overflow occurred?
  • Is a process still running? The process is specified by a pid file.
  • Do some IP addresses answer to ping?
  • Do network interfaces receive traffic?
  • Is the temperature too high? (Temperature data not always available.)
  • Execute a user defined command to do arbitrary tests.

如果某項檢測失敗,則可能導致一次 soft reboot (類比一次 shutdown 命令的執行)

它還可以通過 /dev/watchdog 來觸發核心 watchdog 的運行。

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.