To achieve the realization of linuxwathLinux comes with a watchdog to monitor system operation, including the watchdog watchdog a kernel module and a user-space program. Watchdog module by/dev/watchdog the character device by the kernel and user-space communication. Once a user-space program to open/dev/watchdog device (commonly known as "open dogs"), which would result in a 1 minute timer is started by the kernel (system default), after that, the user-space programs need to ensure that writes data to the device in 1 minutes (commonly known as "feed the dog on a regular basis"), each write operation can lead to re-set the timer. If a user-space program did not write in 1 minutes, timer expiration will cause a reboot of the system operation ("dog bites man" HA HA). Through this mechanism, we can guarantee the system's core processes running most of the time, even if the process crashes under specific circumstances, due to regular schedule of "feed the dog", Linux system in the role of watchdog to restart (reboot), the core process up and running again.
This program is the user space program.
Tips: You can preview the content of files by clicking file names^_^