SHA256
1
0
forked from pool/systemd
systemd/0001-core-re-sync-bus-name-list-after-deserializing-durin.patch
Dominique Leuenberger d6cba9d3bb Accepting request 381543 from Base:System
- Add two patches which address logind/networkd disappearing from
  dbus (and busctl) even while the units and processes continue
  running.
  0001-core-fix-bus-name-synchronization-after-daemon-reloa.patch
  0001-core-re-sync-bus-name-list-after-deserializing-durin.patch

- drop all compiler/linker option customizations:
  - -pipe option is used by default since day 0
  - get rid of cflags() function which is not needed
  - --hash-size has no impact specially in runtime
  IOW, use the default options for the compiler and the linker,
  there's no point in making systemd different from other package in
  this regards.

- use %make_build instead of 'make %{?_smp_mflags}'

- be more strict on own lib version requirements

- systemd should require udev with the exact same version

- Modify patch handle-numlock-value-in-etc-sysconfig-keyboard.patch
  to allow that open, seek, and read of /dev/mem may fail e.g.
  on XEN based virtual guests (bsc#961120) 

- require curl and bzip2 to build importd
- curl also causes building of journal-upload. That one has rather
  unusal certificate usage, set it's ca root to /etc/pki/systemd
  instead of the built-in default /etc/ssl as journal-remote and
  journal-upload think they kan put stuff in /etc/ssl/certs then but
  that directory is managed by p11-kit and doesn't serve the purpose

OBS-URL: https://build.opensuse.org/request/show/381543
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=230
2016-04-03 21:06:56 +00:00

75 lines
2.7 KiB
Diff

From 8936a5e34dbfa9274348f3fef99f7c9f9327ddf9 Mon Sep 17 00:00:00 2001 [> v228]
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 22 Dec 2015 11:37:09 +0100
Subject: [PATCH] core: re-sync bus name list after deserializing during
daemon-reload
When the daemon reloads, it doesn not actually give up its DBus connection,
as wrongly stated in an earlier commit. However, even though the bus
connection stays open, the daemon flushes out all its internal state.
Hence, if there is a NameOwnerChanged signal after the flush and before the
deserialization, it cannot be matched against any pending unit.
To fix this, rename bus_list_names() to manager_sync_bus_names() and call
it explicitly at the end of the daemon reload operation.
---
src/core/dbus.c | 4 ++--
src/core/dbus.h | 2 ++
src/core/manager.c | 4 ++++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 58069f5..1d89b9e 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -734,7 +734,7 @@ static int bus_on_connection(sd_event_source *s, int fd, uint32_t revents, void
return 0;
}
-static int bus_list_names(Manager *m, sd_bus *bus) {
+int manager_sync_bus_names(Manager *m, sd_bus *bus) {
_cleanup_strv_free_ char **names = NULL;
const char *name;
Iterator i;
@@ -850,7 +850,7 @@ static int bus_setup_api(Manager *m, sd_bus *bus) {
if (r < 0)
return log_error_errno(r, "Failed to register name: %m");
- r = bus_list_names(m, bus);
+ r = manager_sync_bus_names(m, bus);
if (r < 0)
return r;
diff --git a/src/core/dbus.h b/src/core/dbus.h
index 4f06ad1..ff76166 100644
--- a/src/core/dbus.h
+++ b/src/core/dbus.h
@@ -34,6 +34,8 @@ void bus_track_serialize(sd_bus_track *t, FILE *f);
int bus_track_deserialize_item(char ***l, const char *line);
int bus_track_coldplug(Manager *m, sd_bus_track **t, char ***l);
+int manager_sync_bus_names(Manager *m, sd_bus *bus);
+
int bus_foreach_bus(Manager *m, sd_bus_track *subscribed2, int (*send_message)(sd_bus *bus, void *userdata), void *userdata);
int bus_verify_manage_units_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
diff --git a/src/core/manager.c b/src/core/manager.c
index e65616a..ffe27be 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -2574,6 +2574,10 @@ int manager_reload(Manager *m) {
/* Third, fire things up! */
manager_coldplug(m);
+ /* Sync current state of bus names with our set of listening units */
+ if (m->api_bus)
+ manager_sync_bus_names(m, m->api_bus);
+
assert(m->n_reloading > 0);
m->n_reloading--;
--
2.6.2