Skip to content

service: Display updated WatchdogUSec from sd_notify#15932

Merged
keszybz merged 1 commit intosystemd:masterfrom
cdown:watchdog_usec
May 27, 2020
Merged

service: Display updated WatchdogUSec from sd_notify#15932
keszybz merged 1 commit intosystemd:masterfrom
cdown:watchdog_usec

Conversation

@cdown
Copy link
Copy Markdown
Member

@cdown cdown commented May 26, 2020

Suppose a service has WatchdogSec set to 2 seconds in its unit file. I
then start the service and WatchdogUSec is set correctly:

% systemctl --user show psi-notify -p WatchdogUSec
WatchdogUSec=2s

Now I call sd_notify(0, "WATCHDOG_USEC=10000000"). The new timer seems
to have taken effect, since I only send WATCHDOG=1 every 9 seconds,
and systemd isn't triggering the watchdog handler. However, systemctl show still shows WatchdogUSec as 2s:

% systemctl --user show psi-notify -p WatchdogUSec
WatchdogUSec=2s

This seems surprising, since this "original" watchdog timer isn't the
one taking effect any more. This patch makes it so that we instead
display the new watchdog timer after sd_notify(WATCHDOG_USEC):

% systemctl --user show psi-notify -p WatchdogUSec
WatchdogUSec=10s

Fixes #15726.

Suppose a service has WatchdogSec set to 2 seconds in its unit file. I
then start the service and WatchdogUSec is set correctly:

    % systemctl --user show psi-notify -p WatchdogUSec
    WatchdogUSec=2s

Now I call `sd_notify(0, "WATCHDOG_USEC=10000000")`. The new timer seems
to have taken effect, since I only send `WATCHDOG=1` every 4 seconds,
and systemd isn't triggering the watchdog handler. However, `systemctl
show` still shows WatchdogUSec as 2s:

    % systemctl --user show psi-notify -p WatchdogUSec
    WatchdogUSec=2s

This seems surprising, since this "original" watchdog timer isn't the
one taking effect any more. This patch makes it so that we instead
display the new watchdog timer after sd_notify(WATCHDOG_USEC):

    % systemctl --user show psi-notify -p WatchdogUSec
    WatchdogUSec=10s

Fixes systemd#15726.
@keszybz
Copy link
Copy Markdown
Member

keszybz commented May 27, 2020

bionic-i386 timed out again...

@keszybz keszybz merged commit 4793c31 into systemd:master May 27, 2020
@Emantor Emantor mentioned this pull request Aug 14, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Exposing watchdog_override_usec in systemctl show

2 participants