Use runc for getting list of processes
runc now has a `ps` command with json output to support listing all the processes inside a container. We no longer need to use libcontainer directly for doing this. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
		| @@ -521,11 +521,15 @@ func hostIDFromMap(id uint32, mp []ocs.IDMapping) int { | ||||
| } | ||||
|  | ||||
| func (c *container) Pids() ([]int, error) { | ||||
| 	container, err := c.getLibctContainer() | ||||
| 	out, err := exec.Command(c.runtime, "ps", "--format=json", c.id).CombinedOutput() | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf(string(out)) | ||||
| 	} | ||||
| 	var pids []int | ||||
| 	if err := json.Unmarshal(out, &pids); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return container.Processes() | ||||
| 	return pids, nil | ||||
| } | ||||
|  | ||||
| func (c *container) Stats() (*Stat, error) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Crosby
					Michael Crosby