summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-09-15 15:44:49 +0200
committerGitHub <noreply@github.com>2021-09-15 15:44:49 +0200
commit8f8e9ad7cb041f6ded42870d6b7b48050d0d5e46 (patch)
tree0e1318853175a1bb00c499fe4149b854fe055e67 /src/core/main.c
parentjournalctl: never fail at flushing when the flushed flag is set (diff)
parentwatchdog: use MIN() in update_timeout() (diff)
downloadsystemd-8f8e9ad7cb041f6ded42870d6b7b48050d0d5e46.tar.xz
systemd-8f8e9ad7cb041f6ded42870d6b7b48050d0d5e46.zip
Merge pull request #20650 from fbuihuu/watchdog-rework
Watchdog rework
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 7c915ccbcc..58c7b96881 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1534,14 +1534,12 @@ static int become_shutdown(
else if (streq(shutdown_verb, "kexec"))
watchdog_timer = arg_kexec_watchdog;
- if (watchdog_timer > 0 && watchdog_timer != USEC_INFINITY) {
-
+ if (timestamp_is_set(watchdog_timer)) {
char *e;
- /* If we reboot or kexec let's set the shutdown
- * watchdog and tell the shutdown binary to
- * repeatedly ping it */
- r = watchdog_set_timeout(&watchdog_timer);
+ /* If we reboot or kexec let's set the shutdown watchdog and
+ * tell the shutdown binary to repeatedly ping it */
+ r = watchdog_setup(watchdog_timer);
watchdog_close(r < 0);
/* Tell the binary how often to ping, ignore failure */
@@ -1554,9 +1552,8 @@ static int become_shutdown(
} else
watchdog_close(true);
- /* Avoid the creation of new processes forked by the
- * kernel; at this point, we will not listen to the
- * signals anyway */
+ /* Avoid the creation of new processes forked by the kernel; at this
+ * point, we will not listen to the signals anyway */
if (detect_container() <= 0)
(void) cg_uninstall_release_agent(SYSTEMD_CGROUP_CONTROLLER);