diff --git a/0001-dnf-makecache.timer-move-to-multi-user-to-fix-loop.patch b/0001-dnf-makecache.timer-move-to-multi-user-to-fix-loop.patch new file mode 100644 index 0000000..9b0223c --- /dev/null +++ b/0001-dnf-makecache.timer-move-to-multi-user-to-fix-loop.patch @@ -0,0 +1,50 @@ +From 4ca1555ab6ffb1b916094802440b84e74aca2eb5 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Fri, 13 Jul 2018 00:07:13 -0700 +Subject: [PATCH] dnf-makecache.timer: move to multi-user to fix loop + +In ee96304, `After=network-online.target` was added to the +dnf-makecache.timer service definition. However, it was already +`WantedBy=basic.target`. These two requests are contradictory +in Fedora and probably most distributions, as it seems that +network-online.target requires NetworkManager.service, and +NetworkManger.service requires basic.target. systemd is forced +to break this loop somehow: my testing suggests that it usually +does so by throwing dnf-makecache.timer out of the process, but +sometimes does it by throwing NetworkManager out of the process, +resulting in the network unexpectedly not coming up. See +https://bugzilla.redhat.com/show_bug.cgi?id=1600823 for more. + +This commit resolves this simply having dnf-makecache.timer +WantedBy multi-user.target, not basic.target. I don't think we +*really* want DNF refreshing its caches in what is basically a +recovery environment, after all, and NetworkManager itself is +WantedBy multi-user.target, so if you actually only boot to +basic.target, there is no network up at all after boot (I've +tested this). + +There are other options (e.g. dropping the After network-online +ordering and just trusting the Wants and the ten-minute startup +delay to be sufficient), but we certainly should resolve this +one way or another. + +Resolves: rhbz#1600823 + +Signed-off-by: Adam Williamson +--- + etc/systemd/dnf-makecache.timer | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/etc/systemd/dnf-makecache.timer b/etc/systemd/dnf-makecache.timer +index 72b6b78c..e3e612c8 100644 +--- a/etc/systemd/dnf-makecache.timer ++++ b/etc/systemd/dnf-makecache.timer +@@ -12,4 +12,4 @@ OnUnitInactiveSec=1h + Unit=dnf-makecache.service + + [Install] +-WantedBy=basic.target ++WantedBy=multi-user.target +-- +2.18.0.rc2 + diff --git a/dnf.spec b/dnf.spec index 8791c3d..89e546b 100644 --- a/dnf.spec +++ b/dnf.spec @@ -74,12 +74,16 @@ It supports RPMs, modules and comps groups & environments. Name: dnf Version: 3.0.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: %{pkg_summary} # For a breakdown of the licensing, see PACKAGE-LICENSING License: GPLv2+ and GPLv2 and GPL URL: https://github.com/rpm-software-management/dnf Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +# Avoid systemd dependency loop in dnf-makecache.timer +# https://bugzilla.redhat.com/show_bug.cgi?id=1600823 +# https://github.com/rpm-software-management/dnf/commit/4ca1555ab6ffb1b916094802440b84e74aca2eb5 +Patch0: 0001-dnf-makecache.timer-move-to-multi-user-to-fix-loop.patch BuildArch: noarch BuildRequires: cmake BuildRequires: gettext @@ -479,6 +483,10 @@ rm -vf %{buildroot}%{_bindir}/dnf-automatic-* %endif %changelog +* Mon Jul 16 2018 Adam Williamson - 3.0.3-4 +- Backport fix for dnf-makecache.timer loop from git +- Resolves: rhbz#1600823 + * Thu Jul 12 2018 Fedora Release Engineering - 3.0.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild