Skip to content

Commit

Permalink
Merge pull request #1917 from slp/master
Browse files Browse the repository at this point in the history
libcontainer: map PidsLimit to systemd's TasksMax property
  • Loading branch information
Mrunal Patel committed Nov 13, 2018
2 parents aa7917b + 5c6b9c3 commit f000fe1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libcontainer/cgroups/systemd/apply_systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ func (m *Manager) Apply(pid int) error {
newProp("BlockIOWeight", uint64(c.Resources.BlkioWeight)))
}

if c.Resources.PidsLimit > 0 {
properties = append(properties,
newProp("TasksAccounting", true),
newProp("TasksMax", uint64(c.Resources.PidsLimit)))
}

// We have to set kernel memory here, as we can't change it once
// processes have been attached to the cgroup.
if c.Resources.KernelMemory != 0 {
Expand Down

0 comments on commit f000fe1

Please sign in to comment.