<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Some updates:<br>
</p>
<p><br>
</p>
<p>I found the interface for disable/enable at the interface </p>
org.freedesktop.systemd1.Manager.
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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:
<p><br>
</p>
<div>[Unit]</div>
<div>Description=MyTest<br>
</div>
<div><br>
</div>
<div>[Service]<br>
</div>
<div>ExecStart=<span style="font-size: 12pt;">/usr/local/bin/mytest</span></div>
<div>Restart=always<br>
</div>
<div>RestartSec=5s</div>
<div>CPUQuota=10%<br>
</div>
<div>WatchdogSec=5s<br>
</div>
<div><br>
</div>
<div>[Install]</div>
<div>WantedBy=multi-user.target</div>
<div><br>
<br>
</div>
<p>Best Regards,<br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
Christopher Wong <span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Calibri, Arial, Helvetica, sans-serif;"></span></span></div>
</div>
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> systemd-devel <systemd-devel-bounces@lists.freedesktop.org> on behalf of Christopher Wong<br>
<b>Sent:</b> Tuesday, May 11, 2021 23:07<br>
<b>To:</b> systemd-devel@lists.freedesktop.org<br>
<b>Subject:</b> [systemd-devel] systemctl service-watchdogs yes does not resume</font>
<div> </div>
</div>
<div>
<p>Hi,<br>
</p>
<p><br>
</p>
<p>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.<br>
</p>
<p><br>
</p>
<p>How is "systemctl service-watchdogs [yes|no]" supposed to work?<br>
</p>
<p><br>
</p>
<p>Is there another interface to access disable/enable all watchdogs, which is more suitable for a c-program?<br>
</p>
<p><br>
</p>
<p>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.<br>
</p>
<p><br>
</p>
<p>Best Regards,<br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
Christopher Wong </div>
</div>
</div>
</div>
</div>
</body>
</html>