mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-05-29 17:05:48 +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:
parent
39881ed299
commit
f5b51ea7fc
@ -852,22 +852,19 @@ static int bus_setup_system(Manager *m, sd_bus *bus) {
|
|||||||
assert(m);
|
assert(m);
|
||||||
assert(bus);
|
assert(bus);
|
||||||
|
|
||||||
if (m->running_as == SYSTEMD_SYSTEM)
|
/* On kdbus or if we are a user instance we get the Released message via the system bus */
|
||||||
return 0;
|
if (m->running_as == SYSTEMD_USER || m->kdbus_fd >= 0) {
|
||||||
|
r = sd_bus_add_match(
|
||||||
/* If we are a user instance we get the Released message via
|
bus,
|
||||||
* the system bus */
|
NULL,
|
||||||
r = sd_bus_add_match(
|
"type='signal',"
|
||||||
bus,
|
"interface='org.freedesktop.systemd1.Agent',"
|
||||||
NULL,
|
"member='Released',"
|
||||||
"type='signal',"
|
"path='/org/freedesktop/systemd1/agent'",
|
||||||
"interface='org.freedesktop.systemd1.Agent',"
|
signal_agent_released, m);
|
||||||
"member='Released',"
|
if (r < 0)
|
||||||
"path='/org/freedesktop/systemd1/agent'",
|
log_warning_errno(r, "Failed to register Released match on system bus: %m");
|
||||||
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.");
|
log_debug("Successfully connected to system bus.");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user