[pve-devel] systemd notify/watchdog

Alexandre DERUMIER aderumier at odiso.com
Wed Mar 4 13:47:11 CET 2015


>Ant this opens /dev/watchdog! 
>>So the question is if this is required? 

>From the doc:

"
RuntimeWatchdogSec=, ShutdownWatchdogSec=
Configure the hardware watchdog at runtime and at reboot. Takes a timeout value in seconds (or in other time units if suffixed with "ms", "min", "h", "d", "w"). If RuntimeWatchdogSec= is set to a non-zero value, the watchdog hardware (/dev/watchdog) will be programmed to automatically reboot the system if it is not contacted within the specified timeout interval. The system manager will ensure to contact it at least once in half the specified timeout interval. This feature requires a hardware watchdog device to be present, as it is commonly the case in embedded and server systems. Not all hardware watchdogs allow configuration of the reboot timeout, in which case the closest available timeout is picked. ShutdownWatchdogSec= may be used to configure the hardware watchdog when the system is asked to reboot. It works as a safety net to ensur
"

This is the hardware watchdog, that's seem ok.

What I was talking about is service watchdog (define in service unit file)

http://www.freedesktop.org/software/systemd/man/systemd.service.html

WatchdogSec=
Configures the watchdog timeout for a service. The watchdog is activated when the start-up is completed. The service must call sd_notify(3) regularly with "WATCHDOG=1" (i.e. the "keep-alive ping"). If the time between two such calls is larger than the configured time, then the service is placed in a failed state and it will be terminated with SIGABRT. By setting Restart= to on-failure or always, the service will be automatically restarted. The time configured here will be passed to the executed service process in the WATCHDOG_USEC= environment variable. This allows daemons to automatically enable the keep-alive pinging logic if watchdog support is enabled for the service. If this option is used, NotifyAccess= (see below) should be set to open access to the notification socket provided by systemd. If NotifyAccess= is not set, it will be implicitly set to main. Defaults to 0, which disables this feature.


(We need to implemented in perl sd_notify to tell to systemd at regular interval that the service is running)



----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mercredi 4 Mars 2015 09:25:27
Objet: Re: [pve-devel] systemd notify/watchdog

> >>work without opening /dev/watchdog? 
> 
> I think it's different than hardware watchdog (in case of system hang). 
> 
> Here it's more software watchdog, services tell to systemd that they are 
> running. 
> (for pvestatd, between each loop for example) 
> and if systemd don't receive the notify, it's restart the service. 

I use the following: 

# grep watchdog /etc/systemd/system.conf -i 
RuntimeWatchdogSec=20 
ShutdownWatchdogSec=5min 


Ant this opens /dev/watchdog! 

So the question is if this is required? 



More information about the pve-devel mailing list