[systemd-devel] [PATCH 2/3] Add support for systemctl to set limit of memory+Swap usage

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Mon Sep 16 23:21:27 PDT 2013


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

Add support for systemctl to set limit of memory+Swap usage.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 src/systemctl/systemctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 57e5bb9..116e0b5 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3657,7 +3657,8 @@ static int append_assignment(DBusMessageIter *iter, const char *assignment) {
                     !dbus_message_iter_append_basic(&sub, DBUS_TYPE_BOOLEAN, &b))
                         return log_oom();
 
-        } else if (streq(field, "MemoryLimit") || streq(field, "MemorySoftLimit")) {
+        } else if (streq(field, "MemoryLimit") || streq(field, "MemorySWLimit") ||
+		streq(field, "MemorySoftLimit")) {
                 off_t bytes;
                 uint64_t u;
 
-- 
1.8.2.1



More information about the systemd-devel mailing list