1
0
mirror of https://github.com/systemd/systemd synced 2026-03-30 11:44:49 +02:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Boqun Feng
506bbc8569 virt: Support detection for ARM64 Hyper-V guests
The detection of Microsoft Hyper-V VMs is done by cpuid currently,
however there is no cpuid on ARM64. And since ARM64 is now a supported
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
detect a Hyper-V guest, which is more generic and works for ARM64.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467
2021-10-13 22:22:24 +02:00
Luca Boccassi
0bc0726ead
Merge pull request #21002 from poettering/watchdog-off
minor tweaks to watchdog configuration logic
2021-10-13 20:03:06 +01:00
Lennart Poettering
9c5ea4b143 man: document new systemd.watchdog_sec= kernel cmdline option
Follow-up for: b3aa73e4de614c06c4a27e5635967a0392654fbc
2021-10-13 13:10:34 +02:00
Lennart Poettering
5254d15896 man: document new "off" setting for systemd-system.conf watchdog settings 2021-10-13 13:10:34 +02:00
Lennart Poettering
c91c95e66c core: allow "off" as special watchdog time to be specified
Right now we already understand "default" as special string for enabling
the watchdog but not reconfiguring its timeout (it is internally mapped
to USEC_MAX). To be systematic this adds "off" as special string for
disabling the watchdog logic (it is internally mapped to 0, which is how
this behaviour was previously requested).
2021-10-13 13:10:34 +02:00
6 changed files with 37 additions and 16 deletions

View File

@ -386,8 +386,9 @@
<term><varname>systemd.default_timeout_start_sec=</varname></term>
<listitem>
<para>Overwrites the default start job timeout <varname>DefaultTimeoutStartSec=</varname> at boot. For details,
see <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
<para>Overrrides the default start job timeout <varname>DefaultTimeoutStartSec=</varname> at
boot. For details, see
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
@ -395,7 +396,20 @@
<term><varname>systemd.watchdog_device=</varname></term>
<listitem>
<para>Overwrites the watchdog device path <varname>WatchdogDevice=</varname>. For details, see
<para>Overrrides the watchdog device path <varname>WatchdogDevice=</varname>. For details, see
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>systemd.watchdog_sec=</varname></term>
<listitem>
<para>Overrrides the watchdog timeout settings otherwise configured with
<varname>RuntimeWatchdog=</varname>, <varname>RebootWatchdog=</varname> and
<varname>KExecWatchdogSec=</varname>. Takes a time value (if no unit is specified, seconds is the
implicitly assumed time unit) or the special strings <literal>off</literal> or
<literal>default</literal>. For details, see
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>

View File

@ -135,11 +135,13 @@
<listitem><para>Configure the hardware watchdog at runtime and at reboot. Takes a timeout value in
seconds (or in other time units if suffixed with <literal>ms</literal>, <literal>min</literal>,
<literal>h</literal>, <literal>d</literal>, <literal>w</literal>). If set to zero the watchdog logic
is disabled: no watchdog device is opened, configured, or pinged. If set to the special string
<literal>default</literal> 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).</para>
<literal>h</literal>, <literal>d</literal>, <literal>w</literal>), or the special strings
<literal>off</literal> or <literal>default</literal>. If set to <literal>off</literal>
(alternatively: <literal>0</literal>) the watchdog logic is disabled: no watchdog device is opened,
configured, or pinged. If set to the special string <literal>default</literal> 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).</para>
<para>If <varname>RuntimeWatchdogSec=</varname> is set to a non-zero value, the watchdog hardware
(<filename>/dev/watchdog</filename> or the path specified with <varname>WatchdogDevice=</varname> or

View File

@ -165,6 +165,7 @@ static int detect_vm_dmi_vendor(void) {
{ "Parallels", VIRTUALIZATION_PARALLELS },
/* https://wiki.freebsd.org/bhyve */
{ "BHYVE", VIRTUALIZATION_BHYVE },
{ "Microsoft", VIRTUALIZATION_MICROSOFT },
};
int r;

View File

@ -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;
}

View File

@ -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) {

View File

@ -29,9 +29,9 @@
#CPUAffinity=
#NUMAPolicy=default
#NUMAMask=
#RuntimeWatchdogSec=0
#RuntimeWatchdogSec=off
#RebootWatchdogSec=10min
#KExecWatchdogSec=0
#KExecWatchdogSec=off
#WatchdogDevice=
#CapabilityBoundingSet=
#NoNewPrivileges=no