Add patch for Reload bug

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-16 23:22:34 +01:00
parent d4d36e6a87
commit 176a1807d2
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From e63ebf71edd7947f29389c72e851d8df5c7bedda Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 16 Mar 2018 23:01:05 +0100
Subject: [PATCH] core: when reloading, delay any actions on journal and dbus
connections
manager_recheck_journal() and manager_recheck_dbus() would be called to early
while we were deserialiazing units, before the systemd-journald.service and
dbus.service have been deserialized. In effect we'd disable logging to the
journald and close the bus connection. The first is not very noticable, it
mostly means that logs emitted during deserialization are lost. The second is
more noticeable, because manager_recheck_dbus() would call bus_done_api() and
bus_done_system() and close dbus connections. Logging and bus connection would
then be restored later after the respective units have been deserialized.
This is easily reproduced by calling:
$ sudo gdbus call --system --dest org.freedesktop.systemd1 --object-path /org/freedesktop/systemd1 --method "org.freedesktop.systemd1.Manager.Reload"
which works fine before 8559b3b75cb, and then starts failing with:
Error: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected
None of this should happen, and we should delay changing state until after
deserialization is complete when reloading. manager_reload() already included
the calls to manager_recheck_journal() and manager_recheck_dbus(), so the
connection state will be updated after deserialization during reloading is done.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1554578.
---
src/core/unit.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 815701ad4e..f88aabba61 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2501,8 +2501,11 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
}
}
- manager_recheck_journal(m);
- manager_recheck_dbus(m);
+ if (!MANAGER_IS_RELOADING(u->manager)) {
+ manager_recheck_journal(m);
+ manager_recheck_dbus(m);
+ }
+
unit_trigger_notify(u);
if (!MANAGER_IS_RELOADING(u->manager)) {

View File

@ -13,7 +13,7 @@
Name: systemd Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 238 Version: 238
Release: 3%{?gitcommit:.git%{gitcommitshort}}%{?dist} Release: 4%{?gitcommit:.git%{gitcommitshort}}%{?dist}
# For a breakdown of the licensing, see README # For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+ License: LGPLv2+ and MIT and GPLv2+
Summary: System and Service Manager Summary: System and Service Manager
@ -50,6 +50,7 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
Patch0001: 0001-test-cgroup-util-bail-out-when-running-under-mock.patch Patch0001: 0001-test-cgroup-util-bail-out-when-running-under-mock.patch
Patch0002: 0002-basic-fs-util-skip-fsync_directory_of_file-if-proc-s.patch Patch0002: 0002-basic-fs-util-skip-fsync_directory_of_file-if-proc-s.patch
Patch0003: 0003-core-when-reloading-delay-any-actions-on-journal-and.patch
Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
@ -704,6 +705,9 @@ fi
%files tests -f .file-list-tests %files tests -f .file-list-tests
%changelog %changelog
* Fri Mar 16 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 238-4
- Do not close dbus connection during dbus reload call (#1554578)
* Wed Mar 7 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 238-3 * Wed Mar 7 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 238-3
- Revert the patches for GRUB BootLoaderSpec support - Revert the patches for GRUB BootLoaderSpec support
- Add patch for /etc/machine-id creation (#1552843) - Add patch for /etc/machine-id creation (#1552843)