Backport fix for dnf-makecache.timer loop from git (#1600823)

This commit is contained in:
Adam Williamson 2018-07-16 16:44:57 -07:00
parent ec718869f0
commit a847ec355e
2 changed files with 59 additions and 1 deletions

View File

@ -0,0 +1,50 @@
From 4ca1555ab6ffb1b916094802440b84e74aca2eb5 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
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 <awilliam@redhat.com>
---
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

View File

@ -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 <awilliam@redhat.com> - 3.0.3-4
- Backport fix for dnf-makecache.timer loop from git
- Resolves: rhbz#1600823
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild