Example #1
0
func (self *dockerContainerHandler) ListProcesses(listType container.ListType) ([]int, error) {
	c := &cgroups.Cgroup{
		Parent: self.parent,
		Name:   self.id,
	}
	return fs.GetPids(c)
}
Example #2
0
func getPids(config *cgroups.Cgroup) []int {
	pids, err := fs.GetPids(config)
	if err != nil {
		log.Fatal(err)
	}
	return pids
}
Example #3
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)
}
Example #4
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)
}
Example #5
0
func (self *rawContainerHandler) ListProcesses(listType container.ListType) ([]int, error) {
	return fs.GetPids(self.cgroup)
}
Example #6
0
func (self *dockerContainerHandler) ListProcesses(listType container.ListType) ([]int, error) {
	return cgroup_fs.GetPids(&self.cgroup)
}