diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-27 14:00:57 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-27 14:00:57 +0100 |
commit | 2281b56044ac36c1eec0bfc61cf3b172bc9d52b9 (patch) | |
tree | 4e6dd3dfa69989bbee54699aea9c31daedf2fee9 /src/core/dbus-manager.c | |
parent | a8273d12532450cf1c7120e650e3df58f60dd704 (diff) | |
parent | e9fd88f2e9a2effb7bcc1541a66263a5f97ce0a6 (diff) |
Merge pull request #1828 from fbuihuu/set-property-on-inactive-unit
core: allow 'SetUnitProperties()' to run on inactive units too
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r-- | src/core/dbus-manager.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 4d730290b2..2562396180 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -630,9 +630,13 @@ static int method_set_unit_properties(sd_bus_message *message, void *userdata, s if (r < 0) return r; - u = manager_get_unit(m, name); - if (!u) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name); + r = manager_load_unit(m, name, NULL, error, &u); + if (r < 0) + return r; + + r = bus_unit_check_load_state(u, error); + if (r < 0) + return r; return bus_unit_method_set_properties(message, u, error); } |