Beispiel #1
0
func (m *Manager) GetAllPids() ([]int, error) {
	path, err := getSubsystemPath(m.Cgroups, "devices")
	if err != nil {
		return nil, err
	}
	return cgroups.GetAllPids(path)
}
Beispiel #2
0
func (m *Manager) GetAllPids() ([]int, error) {
	dir, err := getCgroupPath(m.Cgroups)
	if err != nil {
		return nil, err
	}
	return cgroups.GetAllPids(dir)
}
Beispiel #3
0
func (stopper *CgroupStopper) killAllRemaining(signal syscall.Signal, cgroupPath string, exceptions []int) error {
	pidsInCgroup, err := cgroups.GetAllPids(cgroupPath)
	if err != nil {
		return err
	}

	var pidsToKill []int
	for _, pid := range pidsInCgroup {
		if contains(exceptions, pid) {
			continue
		}

		pidsToKill = append(pidsToKill, pid)
	}

	if len(pidsToKill) == 0 {
		return nil
	}

	stopper.killer.Kill(signal, pidsToKill...)
	return fmt.Errorf("still running after signal %s, %v", signal, pidsToKill)
}
Beispiel #4
0
func (m *Manager) GetAllPids() ([]int, error) {
	paths := m.GetPaths()
	return cgroups.GetAllPids(paths["devices"])
}