summaryrefslogtreecommitdiff
path: root/src/machine/machinectl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-24 21:05:09 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-24 22:46:45 +0200
commitfbe550738d03b178bb004a1390e74115e904118a (patch)
treea4a281a5c7d7fb95ad409ba424eb2a430f1cc664 /src/machine/machinectl.c
parentb9a8d250810d4803bc9bf6b36932b528cb991d1e (diff)
machined: introduce pseudo-machine ".host" refererring to the host system
Some of the operations machined/machinectl implement are also very useful when applied to the host system (such as machinectl login, machinectl shell or machinectl status), hence introduce a pseudo-machine by the name of ".host" in machined that refers to the host system, and may be used top execute operations on the host system with. This copies the pseudo-image ".host" machined already implements for image related commands. (This commit also adds a PK privilege for opening a PTY in a container, which was previously not accessible for non-root.)
Diffstat (limited to 'src/machine/machinectl.c')
-rw-r--r--src/machine/machinectl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 72b9a619d2..c84deba1c0 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -358,7 +358,8 @@ 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" : "org.freedesktop.systemd1.Service",
+ endswith(unit, ".scope") ? "org.freedesktop.systemd1.Scope" :
+ endswith(unit, ".slice") ? "org.freedesktop.systemd1.Slice" : "org.freedesktop.systemd1.Service",
"ControlGroup",
&error,
&reply,
@@ -372,9 +373,6 @@ static int show_unit_cgroup(sd_bus *bus, const char *unit, pid_t leader) {
if (r < 0)
return bus_log_parse_error(r);
- if (isempty(cgroup))
- return 0;
-
if (cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, cgroup, false) != 0 && leader <= 0)
return 0;