diff --git a/libcontainer/cgroups/systemd/v1.go b/libcontainer/cgroups/systemd/v1.go index 59a8b1e72..17df7cca3 100644 --- a/libcontainer/cgroups/systemd/v1.go +++ b/libcontainer/cgroups/systemd/v1.go @@ -158,7 +158,8 @@ func (m *legacyManager) Apply(pid int) error { newProp("MemoryAccounting", true), newProp("CPUAccounting", true), newProp("BlockIOAccounting", true), - newProp("TasksAccounting", true)) + newProp("TasksAccounting", true), + ) // Assume DefaultDependencies= will always work (the check for it was previously broken.) properties = append(properties, diff --git a/libcontainer/cgroups/systemd/v2.go b/libcontainer/cgroups/systemd/v2.go index 65abc0592..a4ec752ed 100644 --- a/libcontainer/cgroups/systemd/v2.go +++ b/libcontainer/cgroups/systemd/v2.go @@ -141,7 +141,6 @@ func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (pr } } props = append(props, - newProp("TasksAccounting", true), newProp("TasksMax", num)) case "memory.oom.group": @@ -272,7 +271,9 @@ func (m *unifiedManager) Apply(pid int) error { properties = append(properties, newProp("MemoryAccounting", true), newProp("CPUAccounting", true), - newProp("IOAccounting", true)) + newProp("IOAccounting", true), + newProp("TasksAccounting", true), + ) // Assume DefaultDependencies= will always work (the check for it was previously broken.) properties = append(properties,