summaryrefslogtreecommitdiff
path: root/src/shared/bus-util.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-09-10 19:11:29 +0200
committerDaniel Mack <github@zonque.org>2015-09-10 19:11:29 +0200
commita18f3caa5613196700062e5f4cf55f36a3f76f2c (patch)
tree248315bbd774c6111b5e1c10ba52e6ba5e0c499b /src/shared/bus-util.c
parent786c5bf957f8f7b78c7a0999908ff822e712b53e (diff)
parent03a7b521e3ffb7f5d153d90480ba5d4bc29d1e8f (diff)
Merge pull request #1239 from poettering/cgroup-pids
core: add support for the "pids" cgroup controller
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r--src/shared/bus-util.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 64a810fc8f..4dc4ca581d 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1421,7 +1421,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
return bus_log_create_error(r);
if (STR_IN_SET(field,
- "CPUAccounting", "MemoryAccounting", "BlockIOAccounting",
+ "CPUAccounting", "MemoryAccounting", "BlockIOAccounting", "TasksAccounting",
"SendSIGHUP", "SendSIGKILL", "WakeSystem", "DefaultDependencies",
"IgnoreSIGPIPE", "TTYVHangup", "TTYReset", "RemainAfterExit")) {
@@ -1436,14 +1436,33 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
} else if (streq(field, "MemoryLimit")) {
uint64_t bytes;
- r = parse_size(eq, 1024, &bytes);
- if (r < 0) {
- log_error("Failed to parse bytes specification %s", assignment);
- return -EINVAL;
+ if (isempty(eq) || streq(eq, "infinity"))
+ bytes = (uint64_t) -1;
+ else {
+ r = parse_size(eq, 1024, &bytes);
+ if (r < 0) {
+ log_error("Failed to parse bytes specification %s", assignment);
+ return -EINVAL;
+ }
}
r = sd_bus_message_append(m, "v", "t", bytes);
+ } else if (streq(field, "TasksMax")) {
+ uint64_t n;
+
+ if (isempty(eq) || streq(eq, "infinity"))
+ n = (uint64_t) -1;
+ else {
+ r = safe_atou64(eq, &n);
+ if (r < 0) {
+ log_error("Failed to parse maximum tasks specification %s", assignment);
+ return -EINVAL;
+ }
+ }
+
+ r = sd_bus_message_append(m, "v", "t", n);
+
} else if (STR_IN_SET(field, "CPUShares", "BlockIOWeight")) {
uint64_t u;