Add explicit service unit ordering, after multi-user.target

Backports: https://github.com/coreos/zincati/pull/831
This commit is contained in:
Luca BRUNO 2022-09-20 07:56:15 +00:00
parent 3c26a9c71a
commit f8c1d87161
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,32 @@
commit 6eefd62822b8dd767a9902cd20eca7d8976ff2a1
Author: Luca BRUNO <luca.bruno@coreos.com>
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.

View File

@ -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 <lucab@lucabruno.net> - 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 <releng@fedoraproject.org> - 0.0.24-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild