Disable oom_killer
authorJagger <robert@swiecki.net>
Sun, 19 Jun 2016 14:39:41 +0000 (16:39 +0200)
committerJagger <robert@swiecki.net>
Sun, 19 Jun 2016 14:39:41 +0000 (16:39 +0200)
cgroup.c

index d0fc92bc820e5c972aec556dccbe7e757261a366..e7034da917c86778315044ed18690b83fa4e4d8d 100644 (file)
--- a/cgroup.c
+++ b/cgroup.c
@@ -63,6 +63,13 @@ bool cgroupInitNsFromParent(struct nsjconf_t *nsjconf, pid_t pid)
                }
        }
 
+       snprintf(fname, sizeof(fname), "%s/memory.oom_control", mem_cgroup_path);
+       LOG_D("Writting '1' '%s/memory.oom_control'", mem_cgroup_path);
+       if (utilWriteBufToFile(fname, "1", strlen("1"), O_WRONLY) == false) {
+               LOG_E("Could not update memory cgroup oom control");
+               return false;
+       }
+
        char pid_str[512];
        snprintf(pid_str, sizeof(pid_str), "%d", (int)pid);
        snprintf(fname, sizeof(fname), "%s/tasks", mem_cgroup_path);