diff --git a/libcontainer/cgroups/systemd/v2.go b/libcontainer/cgroups/systemd/v2.go index 78a27eaa079..6ded4c8e97e 100644 --- a/libcontainer/cgroups/systemd/v2.go +++ b/libcontainer/cgroups/systemd/v2.go @@ -128,6 +128,15 @@ func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (pr newProp("TasksAccounting", true), newProp("TasksMax", num)) + case "memory.oom.group": + // Setting this to 1 is roughly equivalent to OOMPolicy=kill + // (as per systemd.service(5) and + // https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html), + // but it's not clear what to do if it is unset or set + // to 0 in runc update, as there are two other possible + // values for OOMPolicy (continue/stop). + fallthrough + default: // Ignore the unknown resource here -- will still be // applied in Set which calls fs2.Set.