Exemple #1
0
func (m *Manager) GetAllPids() ([]int, error) {
	path, err := getSubsystemPath(m.Cgroups, "devices")
	if err != nil {
		return nil, err
	}
	return cgroups.GetAllPids(path)
}
Exemple #2
0
func (m *Manager) GetAllPids() ([]int, error) {
	dir, err := getCgroupPath(m.Cgroups)
	if err != nil {
		return nil, err
	}
	return cgroups.GetAllPids(dir)
}
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)
}
Exemple #4
0
func (m *Manager) GetAllPids() ([]int, error) {
	paths := m.GetPaths()
	return cgroups.GetAllPids(paths["devices"])
}