You are not logged in.

#1 2013-05-21 20:50:46

graysky
Member
From: :wq
Registered: 2008-12-01
Posts: 9,264
Website

Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

The ARCH kernel ships with watchdog support.  From what I have read, the watchdog is good for embedded devices without reset switches so I am wondering how many are actually using it on a desktop/laptop.  I have disabled it on my own machine due to periodic slow shutdowns due to the watchdog itself hanging on a reboot/shutdown.

Last edited by graysky (2013-06-03 20:18:14)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs • 1.21 JIGOWATTS!

Offline

#2 2013-05-22 00:32:41

hadrons123
Member
From: chennai
Registered: 2011-10-07
Posts: 1,249

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

I yet to find a use for watchdog. Are you planning on disabling in CK kernel?


LENOVO Y 580 IVYBRIDGE 660M NVIDIA
Unix is user-friendly. It just isn't promiscuous about which users it's friendly with. - Steven King

Offline

#3 2013-05-22 00:48:24

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

I was going to suggest that it is commonly used in shutdowns, but you say that is makes your reboot hang?  Maybe that is my problem as well.

Offline

#4 2013-05-22 01:45:05

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,994

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

From my journal:

Mai 20 23:09:34 MyComputer systemd[1]: Starting Reboot...
Mai 20 23:09:34 MyComputer systemd[1]: Shutting down.
Mai 20 23:09:34 MyComputer systemd[1]: Hardware watchdog 'iTCO_wdt', version 0
Mai 20 23:09:34 MyComputer systemd[1]: Set hardware watchdog to 10min.
Mai 20 23:09:34 MyComputer kernel: watchdog watchdog0: watchdog did not stop!

Last edited by cfr (2013-05-22 01:45:20)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Corporation Wireless 8265 / 8275 | US keyboard with Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-05-22 06:37:27

drenninghoff
Member
Registered: 2012-11-28
Posts: 34

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

I believe watchdogs are needed in two scenarios: Servers, which reboot when the system freezes for a specific time and embedded devices without power switches. For Notebook users watchdogs are useless, because you see when your system hangs and can manually restart it. Also, watchdogs draw power in idle state. By default no watchdogs are enabled except the kernel NMI debugging watchdog. You can disable it by appending nmi_watchdog=0 to your kernel boot parameters.

On shutdown systemd automatically enables a 10min watchdog, so people can be sure that the machine will shutdown, even if the system freezes at shutdown. This is what the logs of cfr show.

Offline

#6 2013-05-22 08:54:29

graysky
Member
From: :wq
Registered: 2008-12-01
Posts: 9,264
Website

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

hadrons123 wrote:

I yet to find a use for watchdog. Are you planning on disabling in CK kernel?

No, I am generally curious.  I have disabled it on my own build, but not globally.

drenninghoff wrote:

I believe watchdogs are needed in two scenarios: Servers, which reboot when the system freezes for a specific time and embedded devices without power switches. For Notebook users watchdogs are useless, because you see when your system hangs and can manually restart it. Also, watchdogs draw power in idle state. By default no watchdogs are enabled except the kernel NMI debugging watchdog. You can disable it by appending nmi_watchdog=0 to your kernel boot parameters.

On shutdown systemd automatically enables a 10min watchdog, so people can be sure that the machine will shutdown, even if the system freezes at shutdown. This is what the logs of cfr show.

Thank you for this thoughtful post.  Are you aware of any server configuration you can share?  In other words, what package or script would one use to setup a watchdog that monitors for any freeze and automatically reboots?  Perhaps I am misunderstanding but there is a 2nd piece of software, right?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs • 1.21 JIGOWATTS!

Offline

#7 2013-05-22 09:13:31

drenninghoff
Member
Registered: 2012-11-28
Posts: 34

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

I believe for most scenarios (rebooting when the system hangs) a 2nd piece of software is not needed. The author of systemd has written a detailed article about watchdogs that might be interesting for you.

Edit: So for a simple server without specific requirements it's as easy as setting RuntimeWatchdogSec=20 in /etc/systemd/system.conf. This will ping every 10 seconds and will reboot if there's no ping for 20 seconds.

I'm not using watchdogs so I don't know more than what is in this article and what I've written above smile.

Last edited by drenninghoff (2013-05-22 09:19:48)

Offline

#8 2013-05-22 14:28:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

I didn't really think about this until now.  But I have a home server (which is actually just an old HP with a PentiumD and as much crap as possible stripped out), on which I use the CK kernel.  On it, I have set it up to use the watchdog functionality of systemd.  I have RuntimeWatchdogSec=30.  It has actually worked for me a couple times, which is pretty cool.  So I could always switch kernels, but I guess this means that I am putting a vote in for letting the user disable the watchdog as needed.

On my laptop, insetead of using the nmi_watchdog=0, I use an entry in sysctl.d called (quite creatively) nmi-watchdog.conf.  It includes kernel.watchdog=0, and from what I have read, this has the same functionality as that kernel command line addition.

Edit: Which BTW, means that you can also do a simple "echo 0 > /proc/sys/kernel/watchdog".

Last edited by WonderWoofy (2013-05-22 14:29:27)

Offline

#9 2013-05-22 19:35:58

johni
Member
Registered: 2012-02-03
Posts: 102

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

drenninghoff wrote:

I believe for most scenarios (rebooting when the system hangs) a 2nd piece of software is not needed. The author of systemd has written a detailed article about watchdogs that might be interesting for you.

Edit: So for a simple server without specific requirements it's as easy as setting RuntimeWatchdogSec=20 in /etc/systemd/system.conf. This will ping every 10 seconds and will reboot if there's no ping for 20 seconds.

I'm not using watchdogs so I don't know more than what is in this article and what I've written above smile.

Thanks for pointing out that article.  I have a server at home that I occasionally have to reboot remotely from work (after a pacman kernel upgrade or the like).  It has a nasty habit of hanging during shutdown at least 50% of the times I do it.  So I have gotten into the habit of manually umounting as much as possible and doing a nasty unclean reboot (reboot -f).

I tried setting the ShutdownWatchdogSec=5min in /etc/systemd/system.conf, and it seems to have worked!  I've rebooted a couple of times now via the clean (systemctl reboot), and one even took a while, so I am assuming the 5min shutdown setting worked.

Offline

#10 2013-05-22 19:44:07

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

You know you can use something lower than 5 min.  I think if a process hangs past a couple minutes on a normal machine (or in your case home server) it is probably truly hung.  So I see no point in waiting an additiona three minutes to have the watchdog kick in.  OTOH, if you run anything that you know can take a long time to shut itself down, you will need to adjust this time accordingly.  I think the dfault 10 minutes is simply to try and accomodate absolutely anything and everything.

Offline

#11 2013-05-22 21:20:03

johni
Member
Registered: 2012-02-03
Posts: 102

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

I picked 5 minutes based on a certain app that does a ton of constant disk i/o, and I wanted to be sure it had time to shutdown and hopefully the filesystem it was writing to was cleanly unmounted.  It should take it significantly less time than this, but a little more time is no big deal.  I am used to it often not booting back up at all until I come home and press the reset button or power cycle.  So waiting a max of 5 minutes for the shutdown to complete a small price to pay for a little peace of mind and assurance that I will be able to login back in without making a trip.

And when I AM home and reboot it with my laptop from another room, the 5 minutes is within my threshold of laziness where I don't have to get up off my ass to fix it smile

Offline

#12 2013-05-23 01:09:52

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

Isn't NMI Watchdog is disabled by laptop-mode-tools and tlp?

Offline

#13 2013-06-03 20:18:04

graysky
Member
From: :wq
Registered: 2008-12-01
Posts: 9,264
Website

Re: Anyone using watchdog daemons on a desktop/laptop? [SOLVED]

drenninghoff wrote:

I believe for most scenarios (rebooting when the system hangs) a 2nd piece of software is not needed. The author of systemd has written a detailed article about watchdogs that might be interesting for you.

Thanks, I enabled one on a test box for the past few weeks and found that I had an inordinate number of freeze/restarts.  When I disabled the watchdog, the machine went back to its reliable mode of 24/7 operation hmm

Marking this thread as solved.  Thanks all.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs • 1.21 JIGOWATTS!

Offline

Board footer

Powered by FluxBB