diff options
author | Denis Kenzior <denkenz@gmail.com> | 2014-08-18 20:21:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-18 21:01:57 +0200 |
commit | fe3f22d116f6f0cac3bdfa512ac54c0faf8bb7cd (patch) | |
tree | 9aaa2dc5b7a119be93e8e14b3d8a7a3404e3078c /src/libsystemd/sd-bus/bus-control.c | |
parent | man: mention that "units" are commonly system services (diff) | |
download | systemd-fe3f22d116f6f0cac3bdfa512ac54c0faf8bb7cd.tar.xz systemd-fe3f22d116f6f0cac3bdfa512ac54c0faf8bb7cd.zip |
bus-control: Fix cgroup handling
On systems without properly setup systemd, cg_get_root_path returns
-ENOENT. This means that busctl doesn't display much information.
busctl monitor also fails whenever it intercepts messages.
This fix fakes creates a fake "/" root cgroup which lets busctl work
on such systems.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-control.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-control.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c index 076bbce6b1..ad372f6772 100644 --- a/src/libsystemd/sd-bus/bus-control.c +++ b/src/libsystemd/sd-bus/bus-control.c @@ -495,11 +495,9 @@ static int bus_get_owner_kdbus( goto fail; } - if (!bus->cgroup_root) { - r = cg_get_root_path(&bus->cgroup_root); - if (r < 0) - goto fail; - } + r = bus_get_root_path(bus); + if (r < 0) + goto fail; c->cgroup_root = strdup(bus->cgroup_root); if (!c->cgroup_root) { |