- r = parse_env_file(m, NEWLINE, "CGROUP", &root, NULL);
+ r = parse_env_file(m, NEWLINE, "SCOPE", &scope, NULL);
+ if (r < 0) {
+ log_error("Failed to get machine path: %s", strerror(-r));
+ goto finish;
+ }
+
+ path = unit_dbus_path_from_name(scope);
+ if (!path) {
+ r = log_oom();
+ goto finish;
+ }
+
+ r = sd_bus_get_property(
+ bus,
+ "org.freedesktop.systemd1",
+ path,
+ "org.freedesktop.systemd1.Scope",
+ "ControlGroup",
+ &error,
+ &reply,
+ "s");
+
+ if (r < 0) {
+ log_error("Failed to query ControlGroup: %s", bus_error_message(&error, -r));
+ goto finish;
+ }
+
+ r = sd_bus_message_read(reply, "s", &cgroup);
+ if (r < 0) {
+ bus_log_parse_error(r);
+ goto finish;
+ }
+
+ root = strdup(cgroup);
+ if (!root) {
+ r = log_oom();
+ goto finish;
+ }
+