init_linux.go
func killCgroupProcesses(m cgroups.Manager) error {
	var procs []*os.Process
	if err := m.Freeze(configs.Frozen); err != nil {
		logrus.Warn(err)
	}
	pids, err := m.GetPids()
	if err != nil {
		m.Freeze(configs.Thawed)
		return err
	}
	for _, pid := range pids {
		if p, err := os.FindProcess(pid); err == nil {
			procs = append(procs, p)
			if err := p.Kill(); err != nil {
				logrus.Warn(err)
			}
		}
	}
	if err := m.Freeze(configs.Thawed); err != nil {
		logrus.Warn(err)
	}
	for _, p := range procs {
		if _, err := p.Wait(); err != nil {
			logrus.Warn(err)
		}
	}
	return nil
}
func killCgroupProcesses(m cgroups.Manager) error {
	var procs []*os.Process
	if err := m.Freeze(configs.Frozen); err != nil {
		logrus.Warn(err)
	}
	pids, err := m.GetPids()
	if err != nil {
		m.Freeze(configs.Thawed)
		return err
	}
	for _, pid := range pids {
		if p, err := os.FindProcess(pid); err == nil {
			procs = append(procs, p)
			if err := p.Kill(); err != nil {
				logrus.Warn(err)
			}
		}
	}
	if err := m.Freeze(configs.Thawed); err != nil {
		logrus.Warn(err)
	}
	for _, p := range procs {
		if _, err := p.Wait(); err != nil {
			logrus.Warn(err)
		}
	}
	return nil
}
func killCgroupProcesses ( m cgroups . Manager ) error { var procs [ ] * os . Process if err := m . Freeze ( configs . Frozen ) ; err != nil { logrus . Warn ( err ) } pids , err := m . GetPids ( ) if err != nil { m . Freeze ( configs . Thawed ) return err } for _ , pid := range pids { if p , err := os . FindProcess ( pid ) ; err == nil { procs = append ( procs , p ) if err := p . Kill ( ) ; err != nil { logrus . Warn ( err ) } } } if err := m . Freeze ( configs . Thawed ) ; err != nil { logrus . Warn ( err ) } for _ , p := range procs { if _ , err := p . Wait ( ) ; err != nil { logrus . Warn ( err ) } } return nil }
// killCgroupProcesses freezes then iterates over all the processes inside the
// manager's cgroups sending a SIGKILL to each process then waiting for them to
// exit.
killCgroupProcesses freezes then iterates over all the processes inside the manager s cgroups sending a SIGKILL to each process then waiting for them to exit .