Linux Mint: Watchdog configuration
From fit-PC wiki
List of tested devices
- The guide was tested on a systems with the specs listed below, but should be easily adaptable
Device: fitlet2 BIOS: 05/14/2018 American Megatrends Inc. FLT2.0.40.01.00 OS: Linux Mint 19 Tara Kernel: 4.15.0-20-generic Kernel module: iTCO_wdt
Device: fitlet1 BIOS: 11/30/2015 American Megatrends Inc. SBCFLT_0.08.08 OS: Linux Mint 19 Tara Kernel: 4.15.0-20-generic Kernel module: sp5100_tco
- Notes
- fitlet1: sp5100_tco conflicts with i2c_piix4 for I/O address 0x0cd6
echo "# fitlet1: sp5100_tco conflicts with i2c_piix4 for I/O address 0x0cd6 blacklist i2c_piix4" | sudo tee -a /etc/modprobe.d/blacklist.conf
Usage example
- The following usage example represented on fitlet2 with kernel module iTCO_wdt
- Verify it can be loaded successfully and information about the device appears in dmesg output
$ sudo modprobe iTCO_wdt $ dmesg | grep -i iTCO [ 34.741071] iTCO_vendor_support: vendor-support=0 [ 34.742749] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.11 [ 34.742824] iTCO_wdt: Found a Apollo Lake SoC TCO device (Version=5, TCOBASE=0x0460) [ 34.742993] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
- Install watchdog program, it should run in the background automatically on each system start
$ sudo apt install watchdog
- Modify the following configuration files:
/etc/default/watchdog change: watchdog_module="none" to: watchdog_module="iTCO_wdt"
/etc/watchdog.conf uncomment line: watchdog-device = /dev/watchdog
/lib/systemd/system/watchdog.service add "WantedBy=default.target" line under [Install] header, as per below: [Install] WantedBy=default.target * NOTE: this a bugfix that required for LinuxMint18.3
- Try watchdog service and ensure it is running correctly
$ sudo systemctl start watchdog $ sudo systemctl status watchdog ● watchdog.service - watchdog daemon Loaded: loaded (/lib/systemd/system/watchdog.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2018-04-17 03:30:58 EDT; 3min 3s ago Main PID: 1143 (watchdog) CGroup: /system.slice/watchdog.service └─1143 /usr/sbin/watchdog Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: int=1s realtime=yes sync=no soft=no mla=0 mem=0 Apr 17 03:30:58 denis-fitlet2 systemd[1]: Started watchdog daemon. Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: ping: no machine to check Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: file: no file to check Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: pidfile: no server process to check Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: interface: no interface to check Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: temperature: no sensors to check Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: test=none(0) repair=none(0) alive=/dev/watchdog heartbeat=none to=root no_act=no force=no Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: watchdog now set to 60 seconds Apr 17 03:30:58 denis-fitlet2 watchdog[1143]: hardware watchdog identity: iTCO_wdt
- Enable autostart of the watchdog service
$ sudo systemctl enable watchdog Synchronizing state of watchdog.service with SysV init with /lib/systemd/systemd-sysv-install... Executing /lib/systemd/systemd-sysv-install enable watchdog
- Reboot
- Verify the the driver was loaded automatically
$ dmesg | grep -i iTCO
- Simulate kernel panic (as root user):
$ su Password: $ echo 1 > /proc/sys/kernel/sysrq $ echo c > /proc/sysrq-trigger
- As a result, the watchdog mechanism should reboot the system within 30 seconds.