Beispiel #1
0
func getPids(config *cgroups.Cgroup) []int {
	pids, err := fs.GetPids(config)
	if err != nil {
		log.Fatal(err)
	}
	return pids
}
Beispiel #2
0
func psAction(context *cli.Context) {
	config, err := getConfig(context)
	if err != nil {
		log.Fatal(err)
	}

	pids, err := fs.GetPids(config)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Pids in '%s':\n", config.Name)
	fmt.Println(pids)
}
Beispiel #3
0
func (d *driver) GetPidsForContainer(id string) ([]int, error) {
	d.Lock()
	active := d.activeContainers[id]
	d.Unlock()

	if active == nil {
		return nil, fmt.Errorf("active container for %s does not exist", id)
	}
	c := active.container.Cgroups

	if systemd.UseSystemd() {
		return systemd.GetPids(c)
	}
	return fs.GetPids(c)
}