diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-10-19 19:02:47 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-10-19 19:02:47 +0200 |
commit | aa486a72be9903daf870b050616769d1b4e78a33 (patch) | |
tree | 6561f4ea355882a41dbc4267c652a27dd85c5586 /src/core | |
parent | 9badb85de0821c98c7adf5dc90b2ba590987dbb5 (diff) | |
parent | e9cc999a306a789049304997f855dec2eabe5579 (diff) |
Merge pull request #1598 from evverx/run-oomscoreadjust
systemd-run can launch units with OOMScoreAdjust
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dbus-execute.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 436229330e..2662b07525 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -1186,6 +1186,24 @@ int bus_exec_context_set_transient_property( return 1; + } else if (streq(name, "OOMScoreAdjust")) { + int oa; + + r = sd_bus_message_read(message, "i", &oa); + if (r < 0) + return r; + + if (!oom_score_adjust_is_valid(oa)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "OOM score adjust value out of range"); + + if (mode != UNIT_CHECK) { + c->oom_score_adjust = oa; + c->oom_score_adjust_set = true; + unit_write_drop_in_private_format(u, mode, name, "OOMScoreAdjust=%i\n", oa); + } + + return 1; + } else if (rlimit_from_string(name) >= 0) { uint64_t rl; rlim_t x; |