From f8c1d87161d66687e790511f5b3c7e7a6f15ee9b Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Tue, 20 Sep 2022 07:56:15 +0000 Subject: [PATCH] Add explicit service unit ordering, after multi-user.target Backports: https://github.com/coreos/zincati/pull/831 --- 0001-after-multi-user.target.patch | 32 ++++++++++++++++++++++++++++++ rust-zincati.spec | 7 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0001-after-multi-user.target.patch diff --git a/0001-after-multi-user.target.patch b/0001-after-multi-user.target.patch new file mode 100644 index 0000000..42ba073 --- /dev/null +++ b/0001-after-multi-user.target.patch @@ -0,0 +1,32 @@ +commit 6eefd62822b8dd767a9902cd20eca7d8976ff2a1 +Author: Luca BRUNO +Date: Mon Sep 19 09:26:32 2022 +0000 + + dist/systemd: add explicit ordering, after multi-user.target + + This tweaks the service unit ordering, adding explicit configuration + for running after `multi-user.target`. + The service unit is currently pulled in by `multi-user.target`, which + results in a implicit `Before` ordering being added by systemd. + Unfortunately this may result in a dependency loop between + `multi-user.target` and `boot-complete.target`, as the latter may need + to start after the former. + Adding an explicit `After` statement here makes sure that both targets + can be properly started in the relevant order, with Zincati queuing + after both of them. + + Ref: https://lists.freedesktop.org/archives/systemd-devel/2022-September/048330.html + +diff --git a/dist/systemd/system/zincati.service b/dist/systemd/system/zincati.service +index ef1173d..1837a09 100644 +--- a/dist/systemd/system/zincati.service ++++ b/dist/systemd/system/zincati.service +@@ -7,7 +7,7 @@ After=network.target + # Wait for the boot to be marked as successful. In cluster contexts, + # this prevents rolling out broken updates to all nodes in the fleet. + Requires=boot-complete.target +-After=boot-complete.target ++After=multi-user.target boot-complete.target + # Make sure we don't inadvertently reboot the system before a machine-id is + # created so that we don't cause ConditionFirstBoot=true units to run twice + # See discussions in https://github.com/systemd/systemd/issues/4511. diff --git a/rust-zincati.spec b/rust-zincati.spec index e6ab082..979f26e 100644 --- a/rust-zincati.spec +++ b/rust-zincati.spec @@ -11,7 +11,7 @@ Name: rust-%{crate} Version: 0.0.24 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Update agent for Fedora CoreOS # Upstream license specification: Apache-2.0 @@ -24,6 +24,7 @@ Source1: https://github.com/coreos/%{crate}/releases/download/v%{version} # git diff --no-prefix zincati-*/Cargo.toml #Patch0: fedora-zincati-cargo-manifest-overrides.diff %endif +Patch0001: 0001-after-multi-user.target.patch ExclusiveArch: %{rust_arches} # Skip 32 bits architectures, see @@ -373,6 +374,10 @@ install -Dpm0644 -t %{buildroot}%{_datadir}/dbus-1/system.d \ %endif %changelog +* Tue Sep 20 2022 Luca BRUNO - 0.0.24-6 +- Add explicit service unit ordering, after multi-user.target + Backports: https://github.com/coreos/zincati/pull/831 + * Sat Jul 23 2022 Fedora Release Engineering - 0.0.24-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild