]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: introduce systemd.watchdog_sec=<sec> option
authorFranck Bui <fbui@suse.com>
Fri, 17 Sep 2021 09:11:14 +0000 (11:11 +0200)
committerFranck Bui <fbui@suse.com>
Wed, 13 Oct 2021 06:58:36 +0000 (08:58 +0200)
src/core/main.c

index 8792ef88fc5c8f0e7bb0380ab2f5c2b6bc9f5638..e2fc6fae61b5d2b31878031de53146b87a6ea74b 100644 (file)
@@ -531,6 +531,17 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
 
                 (void) parse_path_argument(value, false, &arg_watchdog_device);
 
+        } else if (proc_cmdline_key_streq(key, "systemd.watchdog_sec")) {
+
+                if (proc_cmdline_value_missing(key, value))
+                        return 0;
+
+                r = parse_sec(value, &arg_runtime_watchdog);
+                if (r < 0)
+                        log_warning_errno(r, "Failed to parse systemd.watchdog_sec= argument '%s', ignoring: %m", value);
+                else
+                        arg_kexec_watchdog = arg_reboot_watchdog = arg_runtime_watchdog;
+
         } else if (proc_cmdline_key_streq(key, "systemd.clock_usec")) {
 
                 if (proc_cmdline_value_missing(key, value))