-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for (emulated) i6300ESB watchdog #2627
Conversation
I6300ESB is the watchdog device able to be emulated via qemu/kvm therefore enabling watchdog support based on an existing HA addon
Sorry, but I don't get the idea of using a dedicated HA addon for activating the watchdog daemon? AFAIK HomeAssistantOS already comes with the busybox watchdog daemon. It might just require to actually provide a systemd init script to get it activated for the underlying hardware so that in case a hardware watchdog exists the hardware / or the VM will be reset accordingly. So please elaborate. |
I don't object here and it would be the cleaner solution in the end compared to an addon, but in any case we need the kernel driver for both watchdogd or an addon ;) |
Ok, this if course makes sense. However, to allow the watchdog to work in Proxmox one has to execute the following
So that the virtual watchdog is correctly assigned to the VM. Then after startup |
Perhaps it is enough to set |
adapted the proxmox installation script to setup the necessary watchdog option for the VM accordingly. This refs home-assistant/operating-system#2627
Or maybe ha supervisor would be a good place to drive /dev/watchdog the logic is rather trivial anyway. |
Dunno, because @agners has to decide that. But IMHO a hardware watchdog like |
I agree, in general we should let Home Assistant OS or Supervisor handle a Watchdog, not an add-on. From what I know systemd's Watchdog handling is quite versatile as it "watchdogs" systemd, which in turn can then check other processes (and an init system is the perfect agent for such a "watchdog proxy"). Setting |
Normally only one process is able to open a file handle on /dev/watchdog. Since systemd is probably there much earlier than any addon, than the addon would simply fail to start. In any case I didn't want to start a discussion about addons vs watchdogd vs systemd, but simply add kernel driver support for the watchdog device supported by qemu. |
On the interval it seems systemd handles this gracefully, i.e. if the interval setting is not supported it will query the driver for the (fixed) interval supported by the watchdog and use that: https://github.com/systemd/systemd/blob/main/src/shared/watchdog.c#L262 So I guess the most sensible approach would be either to find a suitable interval (I don't know 30s or so) and then enable in systemd-system.conf or just use "default" which should use the watchdog standard:
I just tested it, if there is no watchdog device it will not print any errors unless you explicitly set systemd log-level to debug. So I guess if you are brave we could give it a try. PS: I guess we may want to check if at least the most useful WDT drivers are enabled already in the kernel, thinking about CONFIG_ITCO_WDT on Intel, CONFIG_BCM2835_WDT for RasPi etc. |
Thanks for your investigation! I am fine with giving this a try. I think I'd go with the
For Intel, besides |
I6300ESB is the watchdog device able to be emulated via qemu/kvm e.g. with Proxmox. This enables watchdog support based on an existing HA addon like the one in https://github.com/alex107ivanov/hassio-addons