diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml index f546a1161a..2093edd05c 100644 --- a/man/kernel-command-line.xml +++ b/man/kernel-command-line.xml @@ -386,8 +386,9 @@ systemd.default_timeout_start_sec= - Overwrites the default start job timeout DefaultTimeoutStartSec= at boot. For details, - see systemd-system.conf5. + Overrrides the default start job timeout DefaultTimeoutStartSec= at + boot. For details, see + systemd-system.conf5. @@ -395,7 +396,20 @@ systemd.watchdog_device= - Overwrites the watchdog device path WatchdogDevice=. For details, see + Overrrides the watchdog device path WatchdogDevice=. For details, see + systemd-system.conf5. + + + + + systemd.watchdog_sec= + + + Overrrides the watchdog timeout settings otherwise configured with + RuntimeWatchdog=, RebootWatchdog= and + KExecWatchdogSec=. Takes a time value (if no unit is specified, seconds is the + implicitly assumed time unit) or the special strings off or + default. For details, see systemd-system.conf5. diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index 7288c3b712..2307a8f5c9 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -135,11 +135,13 @@ Configure the hardware watchdog at runtime and at reboot. Takes a timeout value in seconds (or in other time units if suffixed with ms, min, - h, d, w). If set to zero the watchdog logic - is disabled: no watchdog device is opened, configured, or pinged. If set to the special string - default the watchdog is opened and pinged in regular intervals, but the timeout - is not changed from the default. If set to any other time value the watchdog timeout is configured to - the specified value (or a value close to it, depending on hardware capabilities). + h, d, w), or the special strings + off or default. If set to off + (alternatively: 0) the watchdog logic is disabled: no watchdog device is opened, + configured, or pinged. If set to the special string default the watchdog is opened + and pinged in regular intervals, but the timeout is not changed from the default. If set to any other + time value the watchdog timeout is configured to the specified value (or a value close to it, + depending on hardware capabilities). If RuntimeWatchdogSec= is set to a non-zero value, the watchdog hardware (/dev/watchdog or the path specified with WatchdogDevice= or diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 7c844a29df..18d9bb377c 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -6347,6 +6347,8 @@ int config_parse_watchdog_sec( void *data, void *userdata) { + usec_t *usec = data; + assert(filename); assert(lvalue); assert(rvalue); @@ -6354,12 +6356,12 @@ int config_parse_watchdog_sec( /* This is called for {Runtime,Reboot,KExec}WatchdogSec= where "default" maps to * USEC_INFINITY internally. */ - if (streq(rvalue, "default")) { - usec_t *usec = data; - + if (streq(rvalue, "default")) *usec = USEC_INFINITY; - return 0; - } + else if (streq(rvalue, "off")) + *usec = 0; + else + return config_parse_sec(unit, filename, line, section, section_line, lvalue, ltype, rvalue, data, userdata); - return config_parse_sec(unit, filename, line, section, section_line, lvalue, ltype, rvalue, data, userdata); + return 0; } diff --git a/src/core/main.c b/src/core/main.c index 4b8e923a1e..6e01398523 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -544,6 +544,8 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat if (streq(value, "default")) arg_runtime_watchdog = USEC_INFINITY; + else if (streq(value, "off")) + arg_runtime_watchdog = 0; else { r = parse_sec(value, &arg_runtime_watchdog); if (r < 0) { diff --git a/src/core/system.conf.in b/src/core/system.conf.in index e88280bd0a..96fb64d2c1 100644 --- a/src/core/system.conf.in +++ b/src/core/system.conf.in @@ -29,9 +29,9 @@ #CPUAffinity= #NUMAPolicy=default #NUMAMask= -#RuntimeWatchdogSec=0 +#RuntimeWatchdogSec=off #RebootWatchdogSec=10min -#KExecWatchdogSec=0 +#KExecWatchdogSec=off #WatchdogDevice= #CapabilityBoundingSet= #NoNewPrivileges=no