1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-05-28 13:05:47 +03:00

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.
This commit is contained in:
David Herrmann 2015-03-11 16:35:21 +01:00
parent 39881ed299
commit f5b51ea7fc

View File

@ -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;