mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Merge pull request #97 from hqhq/hq_add_oom_kill_disable
Add oom-kill-disable support for systemd
This commit is contained in:
@@ -505,6 +505,11 @@ func joinMemory(c *configs.Cgroup, pid int) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if c.OomKillDisable {
|
||||
if err := writeFile(path, "memory.oom_control", "1"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if c.MemorySwappiness >= 0 && c.MemorySwappiness <= 100 {
|
||||
err = writeFile(path, "memory.swappiness", strconv.FormatInt(c.MemorySwappiness, 10))
|
||||
|
||||
Reference in New Issue
Block a user