...

This simple Linux tweak fixes crashes automatically – and it costs me nothing

Key Highlights:

Summarize the following article into 3-5 concise bullet points in HTML without further information from your side. format:
Elyse Betters Picaro / ZDNETFollow ZDNET: Add us as a preferred source on Google. ZDNET’s key takeaways If your Linux system locks up, it might need rebooting.With the help of a small application, this can be automated.Watchdog is easy to install and free to use.I have several Linux systems in my home lab; some are desktops and some are servers. Ninety-nine percent of the time, those machines work flawlessly. When that one percent happens, any machine that goes south needs help.One way to help is through a small software package called Watchdog. This software runs various checks to determine whether the hardware has “locked up.” If it detects that it has happened, it will reboot the machine. Also: 6 reasons a minimal Linux install might be the smartest move you makeThere are two types of Watchdogs: software and hardware. The hardware Watchdog is much more reliable, but it requires specialized hardware to work. The software Watchdog isn’t quite as reliable, but it works on most Linux systems. How Watchdog worksA kernel module (softdog), in conjunction with the Watchdog service, watches the system with a countdown timer. A virtual device is created (/dev/watchdog).If the virtual device is “kicked” by a process, the timer resets.If the virtual device isn’t “kicked” by a process, Watchdog reboots the system.It’s simple in theory, but the underpinnings are much more complicated. Fortunately, as a user, you don’t have to dig too deeply to get the gist of Watchdog. Also: The first 8 Linux commands every new user should learnAlthough Watchdog can be essential for servers (especially those that don’t have a monitor, keyboard, or mouse connected), it can also be useful for desktops. For example, say you need to log into a Linux machine on your home network from work. If that machine locks up, you won’t be able to access it. If that machine has Watchdog keeping tabs on it, it’ll reboot, and you’ll be able to access it. This can be very handy. You might think Watchdog is hard to set up, but you’ll be surprised that it’s not that much of a challenge, even if you’re just starting out with Linux. Let me show you how it’s done. How to install WatchdogWhat you’ll need: I’m going to demonstrate this on a machine running Ubuntu 24.04. Watchdog is found in the standard Ubuntu repositories (as well as the Fedora standard repositories). For Arch users, you have to use yay to install this software. You’ll also need a user with sudo privileges. The first thing to do is install Watchdog, which can be done with the command:

Show more
sudo apt-get install watchdog -yIf you’re using a Fedora-based machine, the command is: sudo dnf install watchdog -yFor Arch, it’s: yay -S watchdog With Watchdog installed, you then have to load the softdog kernel module, which is done with:

Show more
sudo modprobe softdogVerify the module has loaded with: lsmod | grabbed the softdogIf you see softdog listed, then it’s successfully loaded. Also: The best Linux laptops in 2026: Expert tested for students, hobbyists, and prosCheck to make sure the device node exists with: ls -la /dev/watchdog You’ll also need to have the Watchdog kernel module loaded at boot. If you don’t do this, the service won’t be running after a reboot (so it won’t be watching the system). This is done with:

Show more
Make sure to type this command correctly. Jack Wallen\ZDNETYou’re now ready to configure Watchdog. How to configure Watchdog With Watchdog running, you’ll want to make sure the configuration file is set up such that it’ll actually do what it’s supposed to do when it should. This is done by way of a configuration file. Open that file with the command: sudo nano /etc/watchdog.confIn that file, look for the following lines (they are not found consecutively in the file): # watchdog-device = /dev/watchdog # interval = 1 # watchdog-timeout = 20 # Time in seconds before reboot # realtime = yes # priority = 1 # max-load-1 = 24 # max-load-5 = 18 # max-load-15 = 12 # min-memory = 1 What you need to do is remove the # and the space before each line. Note: If you don’t see the watchdog-timeout = 20 line, manually add it. Save and close the file. You’ll then need to start and enable the service with the command: sudo systemctl enable –now watchdogWatchdog is now running in the background and will do its thing, should something go awry. Also: You can use Linux 7.0 on these 7 distros today – here’s what to expectIf you want to test whether or not Watchdog is working, you can manually cause a kernel panic with the following three commands: sudo sysctl -w kernel.sysrq=1 sudo su – echo c > /proc/sysrq-trigger The system will become unresponsive, and Watchdog should reboot it. The hardware method If you happen to have a hardware watchdog, systemd can be configured to kick it and enact a reboot. Here’s how you configure this. Open the systemd config file with: sudo nano /etc/systemd/system.conf Locate the following lines: #RuntimeWatchdogSec=0#RebootWatchdogSec=10min#WatchdogDevice=Change those lines to: RuntimeWatchdogSec=30RebootWatchdogSec=10minWatchdogDevice=/dev/watchdogSave and close the file. Also: My 5 go-to Linux commands for troubleshooting – and how I use themRestart the systemd daemon with: sudo systemctl daemon-reloadAnd there you have it. You now have a service watching your system and will reboot it, should things go south.
(function() {
window.zdconsent = window.zdconsent || {run:(),cmd:(),useractioncomplete:(),analytics:(),functional:(),social:()};
window.zdconsent.cmd = window.zdconsent.cmd || ();
window.zdconsent.cmd.push(function() {
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=’2.0′;
n.queue=();t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)(0);
s.parentNode.insertBefore(t,s)}(window, document,’script’,
‘https://connect.facebook.net/en_US/fbevents.js’);
fbq(‘set’, ‘autoConfig’, false, ‘789754228632403’);
fbq(‘init’, ‘789754228632403’);
});
})();


License is not valid, please check your API Key!

Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.