Przeglądaj źródła

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)

Michael Crosby 11 lat temu
rodzic
commit
757c7581c8
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      execdriver/lxc/driver.go

+ 2 - 3
execdriver/lxc/driver.go

@@ -301,9 +301,8 @@ func (d *driver) Info(id string) execdriver.Info {
 func (d *driver) GetPidsForContainer(id string) ([]int, error) {
 func (d *driver) GetPidsForContainer(id string) ([]int, error) {
 	pids := []int{}
 	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)
 	cgroupRoot, err := cgroups.FindCgroupMountpoint(subsystem)
 	if err != nil {
 	if err != nil {
 		return pids, err
 		return pids, err