summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-09-19 09:16:14 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-09-21 06:57:29 +0200
commit0a40325573b91ea71070653865f7f6a9cada2bef (patch)
treeb2d96efd8da3f98d69c0b79dc5704cff5afe51da /src
parentMerge pull request #34511 from YHNdnzj/strv-extend-strv-consume (diff)
downloadsystemd-0a40325573b91ea71070653865f7f6a9cada2bef.tar.xz
systemd-0a40325573b91ea71070653865f7f6a9cada2bef.zip
Preset user units on first boot as well
We need to make sure the presets from /usr/lib/systemd/user-preset are applied as well. Currently only the ones from /usr/lib/systemd/system-preset are applied.
Diffstat (limited to 'src')
-rw-r--r--src/core/manager.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 2dddc79722..844a91b605 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1936,12 +1936,16 @@ static void manager_preset_all(Manager *m) {
UnitFilePresetMode mode =
ENABLE_FIRST_BOOT_FULL_PRESET ? UNIT_FILE_PRESET_FULL : UNIT_FILE_PRESET_ENABLE_ONLY;
- r = unit_file_preset_all(RUNTIME_SCOPE_SYSTEM, 0, NULL, mode, NULL, 0);
- if (r < 0)
- log_full_errno(r == -EEXIST ? LOG_NOTICE : LOG_WARNING, r,
- "Failed to populate /etc with preset unit settings, ignoring: %m");
- else
- log_info("Populated /etc with preset unit settings.");
+ RuntimeScope scope;
+
+ FOREACH_ARGUMENT(scope, RUNTIME_SCOPE_SYSTEM, RUNTIME_SCOPE_GLOBAL) {
+ r = unit_file_preset_all(scope, 0, NULL, mode, NULL, 0);
+ if (r < 0)
+ log_full_errno(r == -EEXIST ? LOG_NOTICE : LOG_WARNING, r,
+ "Failed to populate /etc with %s preset unit settings, ignoring: %m", runtime_scope_to_string(scope));
+ else
+ log_info("Populated /etc with %s preset unit settings.", runtime_scope_to_string(scope));
+ }
}
static void manager_ready(Manager *m) {