summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-27 22:30:43 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-28 02:10:10 +0200
commit21b735e798c580e7af8c33ace9f8565860b7f8df (patch)
tree8d9b07c8feb736acb556eac9ef74d1eeda9ae973 /src/machine
parentd56cc298808b2dbfa28ae893d6f47f34df3196b1 (diff)
downloadsystemd-21b735e798c580e7af8c33ace9f8565860b7f8df.tar.gz
systemd-21b735e798c580e7af8c33ace9f8565860b7f8df.tar.bz2
systemd-21b735e798c580e7af8c33ace9f8565860b7f8df.zip
core: add unit_dbus_interface_from_type() to unit-name.h
Let's add a way to get the type-specific D-Bus interface of a unit from either its type or name to src/basic/unit-name.[ch]. That way we can share it with the client side, where it is useful in tools like cgls or machinectl. Also ports over machinectl to make use of this.
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machinectl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 926035d185..8bd0ed756b 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -361,8 +361,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *unit, pid_t leader) {
bus,
"org.freedesktop.systemd1",
path,
- endswith(unit, ".scope") ? "org.freedesktop.systemd1.Scope" :
- endswith(unit, ".slice") ? "org.freedesktop.systemd1.Slice" : "org.freedesktop.systemd1.Service",
+ unit_dbus_interface_from_name(unit),
"ControlGroup",
&error,
&reply,