From 0b1b0a01ab22c088046634c46c496022e7e60673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 11 Mar 2020 09:10:22 +0100 Subject: [PATCH 1/5] man: add a tiny bit of markup --- man/systemd.preset.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/systemd.preset.xml b/man/systemd.preset.xml index 30c838b3d0..795da35ec8 100644 --- a/man/systemd.preset.xml +++ b/man/systemd.preset.xml @@ -70,8 +70,8 @@ either the word enable or disable followed by a space and a unit name (possibly with shell style wildcards), separated by newlines. - Empty lines and lines whose first non-whitespace character is # or - ; are ignored. + Empty lines and lines whose first non-whitespace character is # or + ; are ignored. Presets must refer to the "real" unit file, and not to any aliases. See systemd.unit5 From b5947b5b100f694c93857a82018fb0656d08be34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 11 Mar 2020 13:07:10 +0100 Subject: [PATCH 2/5] homed: replace "home directory" with "home area" in a few places --- man/systemd-homed.service.xml | 7 ++++--- units/systemd-homed.service.in | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/man/systemd-homed.service.xml b/man/systemd-homed.service.xml index 26789a236a..f79c2be2db 100644 --- a/man/systemd-homed.service.xml +++ b/man/systemd-homed.service.xml @@ -18,7 +18,7 @@ systemd-homed.service systemd-homed - Home Directory/User Account Manager + Home Area/User Account Manager @@ -30,13 +30,14 @@ Description systemd-homed is a system service that may be used to create, remove, change or - inspect home directories. + inspect home areas (directories and network mounts and real or loopback block devices with a filesystem, + optionally encrypted). Most of systemd-homed's functionality is accessible through the homectl1 command. See the Home Directories documentation for - details about the format and design of home directories managed by + details about the format and design of home areas managed by systemd-homed.service. Each home directory managed by systemd-homed.service synthesizes a local user diff --git a/units/systemd-homed.service.in b/units/systemd-homed.service.in index 512804cf0e..7cf98e6fa6 100644 --- a/units/systemd-homed.service.in +++ b/units/systemd-homed.service.in @@ -8,7 +8,7 @@ # (at your option) any later version. [Unit] -Description=Home Manager +Description=Home Area Manager Documentation=man:systemd-homed.service(8) RequiresMountsFor=/home From f1d075dcb7e931cf1e01f277305e531348a7dff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 11 Mar 2020 13:38:14 +0100 Subject: [PATCH 3/5] core: shorten local variable names in do_queue_default_job() There is really no risk of confusion here: it's a simple function that queues one job. --- src/core/main.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/main.c b/src/core/main.c index ac82c723ea..0f49dae73a 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1995,21 +1995,21 @@ static int do_queue_default_job( const char **ret_error_message) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; - const char* default_unit; - Job *default_unit_job; - Unit *target = NULL; + const char *unit; + Job *job; + Unit *target; int r; if (arg_default_unit) - default_unit = arg_default_unit; + unit = arg_default_unit; else if (in_initrd()) - default_unit = SPECIAL_INITRD_TARGET; + unit = SPECIAL_INITRD_TARGET; else - default_unit = SPECIAL_DEFAULT_TARGET; + unit = SPECIAL_DEFAULT_TARGET; - log_debug("Activating default unit: %s", default_unit); + log_debug("Activating default unit: %s", unit); - r = manager_load_startable_unit_or_warn(m, default_unit, NULL, &target); + r = manager_load_startable_unit_or_warn(m, unit, NULL, &target); if (r < 0 && in_initrd() && !arg_default_unit) { /* Fall back to default.target, which we used to always use by default. Only do this if no * explicit configuration was given. */ @@ -2031,13 +2031,13 @@ static int do_queue_default_job( assert(target->load_state == UNIT_LOADED); - r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, NULL, &error, &default_unit_job); + r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, NULL, &error, &job); if (r == -EPERM) { log_debug_errno(r, "Default target could not be isolated, starting instead: %s", bus_error_message(&error, r)); sd_bus_error_free(&error); - r = manager_add_job(m, JOB_START, target, JOB_REPLACE, NULL, &error, &default_unit_job); + r = manager_add_job(m, JOB_START, target, JOB_REPLACE, NULL, &error, &job); if (r < 0) { *ret_error_message = "Failed to start default target"; return log_emergency_errno(r, "Failed to start default target: %s", bus_error_message(&error, r)); @@ -2048,7 +2048,7 @@ static int do_queue_default_job( return log_emergency_errno(r, "Failed to isolate default target: %s", bus_error_message(&error, r)); } - m->default_unit_job_id = default_unit_job->id; + m->default_unit_job_id = job->id; return 0; } From c86c31d9ca3149da6ecc4a435c4c72953f88dcbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 11 Mar 2020 13:40:17 +0100 Subject: [PATCH 4/5] core: log an info line about the default target If the default target is not specified on the kernel command line, it may not be obvious what we are booting into. See for example https://github.com/systemd/systemd/issues/15062#issuecomment-597577464. --- src/core/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/main.c b/src/core/main.c index 0f49dae73a..1a1e09035b 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2046,7 +2046,10 @@ static int do_queue_default_job( } else if (r < 0) { *ret_error_message = "Failed to isolate default target"; return log_emergency_errno(r, "Failed to isolate default target: %s", bus_error_message(&error, r)); - } + } else + log_info("Queued %s job for default target %s.", + job_type_to_string(job->type), + unit_status_string(job->unit)); m->default_unit_job_id = job->id; From 2ca17c7801b82bff793f4280cc8fa50cf9e0fc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 12 Mar 2020 15:21:42 +0100 Subject: [PATCH 5/5] NEWS: add late note about job trimming issue Closes #15091. --- NEWS | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NEWS b/NEWS index 7f241fd642..75432a09df 100644 --- a/NEWS +++ b/NEWS @@ -281,6 +281,20 @@ CHANGES WITH 245: to combine attachment with enablement and invocation, or detachment with stopping and disablement. + * UPGRADE ISSUE: a bug where some jobs were trimmed as redundant was + fixed, which in turn exposed bugs in unit configuration of services + which have Type=oneshot and should only run once, but do not have + RemainAfterExit=yes set. Without RemainAfterExit=yes, a one-shot + service may be started again after exiting successfully, for example + as a dependency in another transaction. Affected services included + some internal systemd services (most notably + systemd-vconsole-setup.service, which was updated to have + RemainAfterExit=yes), and plymouth-start.service. Please ensure that + plymouth has been suitably updated or patched before upgrading to + this systemd release. See + https://bugzilla.redhat.com/show_bug.cgi?id=1807771 for some + additional discussion. + Contributions from: AJ Bagwell, Alin Popa, Andreas Rammhold, Anita Zhang, Ansgar Burchardt, Antonio Russo, Arian van Putten, Ashley Davis, Balint Reczey, Bart Willems, Bastien Nocera, Benjamin Dahlhoff, Charles