From 0916bc6602daed8431537f15fb0e746f54e072f2 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 19 Jun 2023 15:07:24 +0200 Subject: [PATCH] startup-tags: Pull startup-tags from sysinit.target - Make startup-tags a dependency of sysinit-target WantedBy=sysinit.target Before=sysinit.target Note, that while a Wants= idependency in a .target unit would imimply a After= order dependency, this does not apply to dependencies created via from WantedBy, so we have to specify the order explicitly. - Disable default dependencies for this service unit, because service units have a default dependency on sysinit.target and we can't wait for ourself. DefaultDependencies=no - Wait for the root device remounted read/write, so that we can populate /node After=systemd-remount-fs.service With this change, we no longer need to create an explicit dependency to this unit in conditionally started service or socket units, because these units have a default order dependency on sysinit.target and the later basic.target. --- misc_systemd_units/startup-tags.service | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc_systemd_units/startup-tags.service b/misc_systemd_units/startup-tags.service index fc2b4de..21d9d9e 100644 --- a/misc_systemd_units/startup-tags.service +++ b/misc_systemd_units/startup-tags.service @@ -1,7 +1,15 @@ [Unit] +DefaultDependencies=no +After=systemd-remount-fs.service +Before=sysinit.target + [Service] + Type=oneshot RemainAfterExit=yes ExecStart=/usr/sbin/hostconfig --populate-node +[Install] + +WantedBy=sysinit.target