diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2015-03-11 16:35:21 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2015-03-11 16:36:41 +0100 |
commit | f5b51ea7fcb0b6380c3ceb4d4f3f22f647c6fd32 (patch) | |
tree | e5d7fc557473acb5794d1b62243e8e013d83a63b | |
parent | 39881ed299a39ad331262c75d9e627e6ffb848eb (diff) |
core: fix cgroups-agent match for kdbus
On kdbus, we get cgroups-agent messages via the system bus, not the
private systemd socket. Therefore, we must install the match properly or
we will never receive cgroup notifications.
-rw-r--r-- | src/core/dbus.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c index e000cccd11..ae259c37d6 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -852,22 +852,19 @@ static int bus_setup_system(Manager *m, sd_bus *bus) { assert(m); assert(bus); - if (m->running_as == SYSTEMD_SYSTEM) - return 0; - - /* If we are a user instance we get the Released message via - * the system bus */ - r = sd_bus_add_match( - bus, - NULL, - "type='signal'," - "interface='org.freedesktop.systemd1.Agent'," - "member='Released'," - "path='/org/freedesktop/systemd1/agent'", - signal_agent_released, m); - - if (r < 0) - log_warning_errno(r, "Failed to register Released match on system bus: %m"); + /* On kdbus or if we are a user instance we get the Released message via the system bus */ + if (m->running_as == SYSTEMD_USER || m->kdbus_fd >= 0) { + r = sd_bus_add_match( + bus, + NULL, + "type='signal'," + "interface='org.freedesktop.systemd1.Agent'," + "member='Released'," + "path='/org/freedesktop/systemd1/agent'", + signal_agent_released, m); + if (r < 0) + log_warning_errno(r, "Failed to register Released match on system bus: %m"); + } log_debug("Successfully connected to system bus."); return 0; |