Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
old_product:odroid-xu4:application_note:software:linux_watchdog [2017/07/25 11:32]
luke.go [Watchdog demon configuration files]
old_product:odroid-xu4:application_note:software:linux_watchdog [2017/10/19 15:20] (current)
luke.go ↷ Page moved from odroid-xu4:application_note:software:linux_watchdog to old_product:odroid-xu4:application_note:software:linux_watchdog
Line 15: Line 15:
  
  
-**Note that the watchdog driver is available in the Kernel update 3.10.82-52 or higher.**\\+**Note that the watchdog driver is available in the Kernel update 3.10.82 ​/ 4.9.51 ​or higher.**\\
 <code bash target> <code bash target>
 odroid@odroid:​~$ uname -a odroid@odroid:​~$ uname -a
Line 22: Line 22:
  
 ===== Test Watchdog module ===== ===== Test Watchdog module =====
-<​WRAP ​center ​round important 100%>+<WRAP round important 100%>
 Watchdog driver s3c2410_wdt is configurable for Odroid XU3/XU4. Watchdog driver s3c2410_wdt is configurable for Odroid XU3/XU4.
 </​WRAP>​ </​WRAP>​
Line 39: Line 39:
  
 <code bash target> <code bash target>
-$ cat /​dev/​watchdog+sudo cat /​dev/​watchdog
 [ 7639.726211] watchdog watchdog0: watchdog did not stop! [ 7639.726211] watchdog watchdog0: watchdog did not stop!
 </​code>​ </​code>​
Line 50: Line 50:
 ===== Install Watchdog daemon ===== ===== Install Watchdog daemon =====
 To install watchdog daemon To install watchdog daemon
-<​code ​target ​bash>+<code bash target>
 $ sudo apt-get install watchdog $ sudo apt-get install watchdog
 </​code>​ </​code>​
Line 56: Line 56:
 Create dir for watchdog logs files Create dir for watchdog logs files
  
-<​code ​target ​bash>+<​code ​ bash target>
 $ sudo mkdir -p /​var/​log/​watchdog $ sudo mkdir -p /​var/​log/​watchdog
 </​code>​ </​code>​
Line 85: Line 85:
 You need to edit the **/​etc/​watchdog.conf** file to un-comment and so actually use the **/​dev/​watchdog** device access to the module. Otherwise the watchdog will not use the hardware and rely only on its internal code to soft-reboot a broken machine You need to edit the **/​etc/​watchdog.conf** file to un-comment and so actually use the **/​dev/​watchdog** device access to the module. Otherwise the watchdog will not use the hardware and rely only on its internal code to soft-reboot a broken machine
  
-<​code ​target ​bash>+<code bash target>
 $ cat /​etc/​watchdog.conf $ cat /​etc/​watchdog.conf
 #ping                   = 172.31.14.1 #ping                   = 172.31.14.1
Line 143: Line 143:
  
 ===== Start Watchdog Service and Verify ====== ===== Start Watchdog Service and Verify ======
-Watchdog service somehow doesn'​t start automatically. For now if the service doesn'​t start, it can be started with small HACK. 
  
-<​code>​+**on Ubuntu 14.04.x enable watchdog service status** 
 + 
 +In order to start service we need to append /​etc/​rc.local 
 +service watchdog restart 
 +Watchdog service somehow doesn'​t start automatically. For now if the service doesn'​t start, it can be started with small HACK. 
 +<​code ​bash target>
 root@odroidxu4m:​~#​ cat /​etc/​rc.local root@odroidxu4m:​~#​ cat /​etc/​rc.local
 #!/bin/sh -e #!/bin/sh -e
Line 163: Line 167:
  
 exit 0 exit 0
 +</​code>​
 +
 +**on Ubuntu 16.04.x enable watchdog service status**
 +<code bash target>
 +sudo systemctl enable watchdog
 +sudo systemctl start watchdog
 </​code>​ </​code>​
  
 Verify watchdog service in running correctly Verify watchdog service in running correctly
  
-<​code>​+<​code ​bash target>
 root@odroidxu4m:​~#​ service watchdog status root@odroidxu4m:​~#​ service watchdog status
 ● watchdog.service - watchdog daemon ● watchdog.service - watchdog daemon
Line 187: Line 197:
   Aug 28 10:48:43 odroidxu4m watchdog[4738]:​ current load is 0 0 0   Aug 28 10:48:43 odroidxu4m watchdog[4738]:​ current load is 0 0 0
   Aug 28 10:48:43 odroidxu4m watchdog[4738]:​ was able to ping process 2033 (/​var/​run/​rsyslogd.pid).   Aug 28 10:48:43 odroidxu4m watchdog[4738]:​ was able to ping process 2033 (/​var/​run/​rsyslogd.pid).
 +</​code>​
 +
 +Once the watchdog demon is configured it tries to continuously reset the watchdog timer. When/if it fails to do it (because of unresponsive system), the timer will expire and the board will reboot.
 +
 +Another way to test watchdog device is killing the watchdog demon after it has started.
 +<code bash target>
 +root@odroid64:​~#​
 +root@odroid64:​~#​ pkill -9 watchdog ​
 </​code>​ </​code>​