summaryrefslogtreecommitdiff
path: root/src/core/dbus-execute.c
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-17 19:58:29 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-17 20:03:40 +0000
commit6b862936c7c1a55a886e55c247b8fd3b5f41bdfd (patch)
tree00d23d11b1069b9eec5bf81bcd82fec38d5807e3 /src/core/dbus-execute.c
parent257b0719cb9832b7d5e142c77a38d387c531c631 (diff)
run: can launch units with OOMScoreAdjust
Diffstat (limited to 'src/core/dbus-execute.c')
-rw-r--r--src/core/dbus-execute.c18
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;