dbus-scope.c revision 1d22e9068c52c1cf935bcdff70b9b9654e3c939e
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen/***
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen This file is part of systemd.
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen Copyright 2013 Lennart Poettering
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen systemd is free software; you can redistribute it and/or modify it
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen under the terms of the GNU Lesser General Public License as published by
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen the Free Software Foundation; either version 2.1 of the License, or
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen (at your option) any later version.
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen systemd is distributed in the hope that it will be useful, but
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen Lesser General Public License for more details.
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen You should have received a copy of the GNU Lesser General Public License
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen***/
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen#include "selinux-access.h"
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen#include "unit.h"
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen#include "scope.h"
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen#include "dbus.h"
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen#include "bus-util.h"
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen#include "bus-internal.h"
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen#include "bus-common-errors.h"
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen#include "dbus-unit.h"
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen#include "dbus-cgroup.h"
d122f9ee3a0e3c02ff8100a3dcd1866e90a6537aTom Gundersen#include "dbus-kill.h"
4dc355680460fdc8e0d590d8572dff1b6a257d88Tom Gundersen#include "dbus-scope.h"
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersenstatic int bus_scope_abandon(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen Scope *s = userdata;
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen int r;
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen assert(bus);
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen assert(message);
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen assert(s);
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen r = mac_selinux_unit_access_check(UNIT(s), message, "stop", error);
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (r < 0)
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return r;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen r = bus_verify_manage_units_async(UNIT(s)->manager, message, error);
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen if (r < 0)
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen return r;
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen if (r == 0)
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen r = scope_abandon(s);
2dead8129f7b6fe644e17e1dc1739bebacfe1364Tom Gundersen if (r == -ESTALE)
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen return sd_bus_error_setf(error, BUS_ERROR_SCOPE_NOT_RUNNING, "Scope %s is not running, cannot abandon.", UNIT(s)->id);
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen if (r < 0)
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen return r;
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen return sd_bus_reply_method_return(message, NULL);
59b8f6b628145586e87b8a4f6e29c755ad7d61edTom Gundersen}
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen
59b8f6b628145586e87b8a4f6e29c755ad7d61edTom Gundersenstatic BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, scope_result, ScopeResult);
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersenconst sd_bus_vtable bus_scope_vtable[] = {
59b8f6b628145586e87b8a4f6e29c755ad7d61edTom Gundersen SD_BUS_VTABLE_START(0),
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen SD_BUS_PROPERTY("Controller", "s", NULL, offsetof(Scope, controller), SD_BUS_VTABLE_PROPERTY_CONST),
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen SD_BUS_PROPERTY("TimeoutStopUSec", "t", bus_property_get_usec, offsetof(Scope, timeout_stop_usec), SD_BUS_VTABLE_PROPERTY_CONST),
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Scope, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen SD_BUS_SIGNAL("RequestStop", NULL, 0),
7c16313f11e3953f3fe4dbf544f2d36f58d14138Tom Gundersen SD_BUS_METHOD("Abandon", NULL, NULL, bus_scope_abandon, SD_BUS_VTABLE_UNPRIVILEGED),
756775814cf69471f74ce853745bba69f2ba94efThomas Hindoe Paaboel Andersen SD_BUS_VTABLE_END
7c16313f11e3953f3fe4dbf544f2d36f58d14138Tom Gundersen};
7c16313f11e3953f3fe4dbf544f2d36f58d14138Tom Gundersen
7c16313f11e3953f3fe4dbf544f2d36f58d14138Tom Gundersenstatic int bus_scope_set_transient_property(
7c16313f11e3953f3fe4dbf544f2d36f58d14138Tom Gundersen Scope *s,
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen const char *name,
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering sd_bus_message *message,
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering UnitSetPropertiesMode mode,
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering sd_bus_error *error) {
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering int r;
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(s);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(name);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(message);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen if (streq(name, "PIDs")) {
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen unsigned n = 0;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen uint32_t pid;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen r = sd_bus_message_enter_container(message, 'a', "u");
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (r < 0)
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return r;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen while ((r = sd_bus_message_read(message, "u", &pid)) > 0) {
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (pid <= 1)
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return -EINVAL;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (mode != UNIT_CHECK) {
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen r = unit_watch_pid(UNIT(s), pid);
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (r < 0 && r != -EEXIST)
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return r;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen }
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen n++;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen }
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (r < 0)
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return r;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen r = sd_bus_message_exit_container(message);
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (r < 0)
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return r;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (n <= 0)
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidt return -EINVAL;
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidt
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidt return 1;
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidt
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidt } else if (streq(name, "Controller")) {
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen const char *controller;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen char *c;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen r = sd_bus_message_read(message, "s", &controller);
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (r < 0)
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return r;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (!isempty(controller) && !service_name_is_valid(controller))
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Controller '%s' is not a valid bus name.", controller);
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen if (mode != UNIT_CHECK) {
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering if (isempty(controller))
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering c = NULL;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen else {
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering c = strdup(controller);
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering if (!c)
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering return -ENOMEM;
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering }
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen free(s->controller);
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering s->controller = c;
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen }
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering
87322b3aee0dc649ff1ae7a403dcc9d7305baba2Tom Gundersen return 1;
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering } else if (streq(name, "TimeoutStopUSec")) {
8eb9058dc1f99a5eb9b8726a978fcc0720837a10Lennart Poettering
8eb9058dc1f99a5eb9b8726a978fcc0720837a10Lennart Poettering if (mode != UNIT_CHECK) {
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering r = sd_bus_message_read(message, "t", &s->timeout_stop_usec);
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering if (r < 0)
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering return r;
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering unit_write_drop_in_format(UNIT(s), mode, name, "[Scope]\nTimeoutStopSec="USEC_FMT"us\n", s->timeout_stop_usec);
3bdace9bf779ce051f00c14914b35c3a26164aa9Lennart Poettering } else {
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen r = sd_bus_message_skip(message, "t");
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen if (r < 0)
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return r;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen }
3a864fe4a894745ac61f1ecabd7cadf04139a284Tom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return 1;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen }
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
3a864fe4a894745ac61f1ecabd7cadf04139a284Tom Gundersen return 0;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen}
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersenint bus_scope_set_property(
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen Unit *u,
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen const char *name,
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8Lennart Poettering sd_bus_message *message,
8de4a226c71ef43e652274b33b5d19211a44ac7bTom Gundersen UnitSetPropertiesMode mode,
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen sd_bus_error *error) {
20af7091de0cdf92bf299addfc3f96c3ef805bd8Tom Gundersen
59b8f6b628145586e87b8a4f6e29c755ad7d61edTom Gundersen Scope *s = SCOPE(u);
3a864fe4a894745ac61f1ecabd7cadf04139a284Tom Gundersen int r;
d5099efc47d4e6ac60816b5381a5f607ab03f06eMichal Schmidt
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(s);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(name);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(message);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen r = bus_cgroup_set_property(u, &s->cgroup_context, name, message, mode, error);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen if (r != 0)
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return r;
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen if (u->load_state == UNIT_STUB) {
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen /* While we are created we still accept PIDs */
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen r = bus_scope_set_transient_property(s, name, message, mode, error);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen if (r != 0)
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return r;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen r = bus_kill_context_set_transient_property(u, &s->kill_context, name, message, mode, error);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen if (r != 0)
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return r;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen }
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return 0;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen}
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersenint bus_scope_commit_properties(Unit *u) {
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(u);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen unit_update_cgroup_members_masks(u);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen unit_realize_cgroup(u);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen return 0;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen}
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersenint bus_scope_send_request_stop(Scope *s) {
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen _cleanup_bus_message_unref_ sd_bus_message *m = NULL;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen _cleanup_free_ char *p = NULL;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen int r;
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen assert(s);
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen
b44cd8821087f2afebf85fec5b588f5720a9415cTom Gundersen if (!s->controller)
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen return 0;
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen p = unit_dbus_path(UNIT(s));
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen if (!p)
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen return -ENOMEM;
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen r = sd_bus_message_new_signal(
8de4a226c71ef43e652274b33b5d19211a44ac7bTom Gundersen UNIT(s)->manager->api_bus,
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen &m,
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen p,
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen "org.freedesktop.systemd1.Scope",
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen "RequestStop");
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen if (r < 0)
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen return r;
ff734080aa02cd70b13bc0fdeec4a5886166163aTom Gundersen
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen return sd_bus_send_to(UNIT(s)->manager->api_bus, m, /* s->controller */ NULL, NULL);
a6f1e036de8f212f33ead7f5387c297afd8be26eTom Gundersen}
969b009d9416806911b9b52e7e7bc619c0c1a931Tom Gundersen