Some updates:

I found the interface for disable/enable at the interface

org.freedesktop.systemd1.Manager.

I did get another service with WatchdogSec= to print a log every 10s when the 
service watchdogs was disabled. And after enabling the service watchdogs the 
SIGABRT was generated when the watchdog fires. So it works as it I expected.

However, I don't understand why I only got one watchdog ignored log print when 
I just added WatchdogSec= in my test service file. I tried to compare with the 
one that was working, but the only thing I think matter is the Type=notify, 
while my test service didn't have the Type= defined. See my test service file 
below:?


[Unit]
Description=MyTest

[Service]
ExecStart=/usr/local/bin/mytest
Restart=always
RestartSec=5s
CPUQuota=10%
WatchdogSec=5s

[Install]
WantedBy=multi-user.target

?

Best Regards,

Christopher Wong
________________________________
From: systemd-devel <systemd-devel-boun...@lists.freedesktop.org> on behalf of 
Christopher Wong
Sent: Tuesday, May 11, 2021 23:07
To: systemd-devel@lists.freedesktop.org
Subject: [systemd-devel] systemctl service-watchdogs yes does not resume


Hi,


I have put WatchdogSec= in a service file and I can see that the watchdog is 
firing and getting the SIGABRT. I then run "systemctl service-watchdogs no" to 
disable the watchdogs in the system. That works, since I am getting the a log 
print when my service watchdog fires instead of SIGABRT. Then I would like to 
enable the watchdogs again by using "systemctl service-watchdogs yes". However, 
my service no longer has a running watchdog unless I restart it. I would expect 
that all previously fired watchdogs during the disabled period will be resumed, 
but maybe it works in another way or am I missing something.


How is "systemctl service-watchdogs [yes|no]" supposed to work?


Is there another interface to access disable/enable all watchdogs, which is 
more suitable for a c-program?


The reason for above is an application that is occupying the CPU for a longer 
time, which results in many services configured with watchdogs being fired. 
Would like to disable the watchdogs during that period and resume the watchdogs 
one the heavy operation is finished.


Best Regards,

Christopher Wong
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to