How To Install watchdog on CentOS 8

watchdog is Software and/or Hardware watchdog daemon

Introduction

In this tutorial we learn how to install watchdog on CentOS 8.

What is watchdog

The watchdog program can be used as a powerful software watchdog daemon or may be alternately used with a hardware watchdog device such as the IPMI hardware watchdog driver interface to a resident Baseboard Management Controller (BMC). watchdog periodically writes to /dev/watchdog; the interval between writes to /dev/watchdog is configurable through settings in the watchdog sysconfig file. This configuration file is also used to set the watchdog to be used as a hardware watchdog instead of its default software watchdog operation. In either case, if the device is open but not written to within the configured time period, the watchdog timer expiration will trigger a machine reboot. When operating as a software watchdog, the ability to reboot will depend on the state of the machine and interrupts. When operating as a hardware watchdog, the machine will experience a hard reset (or whatever action was configured to be taken upon watchdog timer expiration) initiated by the BMC.

We can use yum or dnf to install watchdog on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install watchdog.

Install watchdog on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install watchdog using dnf by running the following command:

sudo dnf -y install watchdog

Install watchdog on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install watchdog using yum by running the following command:

sudo yum -y install watchdog

How To Uninstall watchdog on CentOS 8

To uninstall only the watchdog package we can use the following command:

sudo dnf remove watchdog

watchdog Package Contents on CentOS 8

/etc/sysconfig/watchdog
/etc/watchdog.conf
/etc/watchdog.d
/usr/lib/.build-id
/usr/lib/.build-id/02
/usr/lib/.build-id/02/1152ba4f96decd10cc6e6d9124f7d78f519e24
/usr/lib/.build-id/4e
/usr/lib/.build-id/4e/d6e4f6a7e85fbde34928f979b9cadcb6ff6a31
/usr/lib/.build-id/b5
/usr/lib/.build-id/b5/0809b8f61fd4b17bc848efd121194413650af4
/usr/lib/systemd/system/watchdog-ping.service
/usr/lib/systemd/system/watchdog.service
/usr/libexec/watchdog/scripts
/usr/sbin/watchdog
/usr/sbin/wd_identify
/usr/sbin/wd_keepalive
/usr/share/doc/watchdog
/usr/share/doc/watchdog/AUTHORS
/usr/share/doc/watchdog/COPYING
/usr/share/doc/watchdog/ChangeLog
/usr/share/doc/watchdog/IAFA-PACKAGE
/usr/share/doc/watchdog/NEWS
/usr/share/doc/watchdog/README
/usr/share/doc/watchdog/README.RHEL
/usr/share/doc/watchdog/README.watchdog.ipmi
/usr/share/doc/watchdog/TODO
/usr/share/doc/watchdog/examples
/usr/share/doc/watchdog/examples/README
/usr/share/doc/watchdog/examples/another-chance.sh
/usr/share/doc/watchdog/examples/dbcheck.sh
/usr/share/doc/watchdog/examples/repair.sh
/usr/share/doc/watchdog/examples/systemcheck.sh
/usr/share/doc/watchdog/examples/uptime.sh
/usr/share/man/man5/watchdog.conf.5.gz
/usr/share/man/man8/watchdog.8.gz
/usr/share/man/man8/wd_identify.8.gz
/usr/share/man/man8/wd_keepalive.8.gz

References

Summary

In this tutorial we learn how to install watchdog on CentOS 8 using yum and dnf.