Use the cpu cgroup subsystem instead of memory because its non optional

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 757c7581c8334b6b527d1c922fe5007d5004eca2
Component: engine
This commit is contained in:
Michael Crosby
2014-02-24 11:08:20 -08:00
parent 45e14307e8
commit 8a923765fc

View File

@ -301,9 +301,8 @@ func (d *driver) Info(id string) execdriver.Info {
func (d *driver) GetPidsForContainer(id string) ([]int, error) {
pids := []int{}
// memory is chosen randomly, any cgroup used by docker works
subsystem := "memory"
// cpu is chosen because it is the only non optional subsystem in cgroups
subsystem := "cpu"
cgroupRoot, err := cgroups.FindCgroupMountpoint(subsystem)
if err != nil {
return pids, err