mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix get pids for nsinit
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
a76407ac61
commit
9bf6cb2692
2 changed files with 3 additions and 4 deletions
|
@ -34,7 +34,7 @@ func getDefaultTemplate() *libcontainer.Container {
|
|||
libcontainer.CLONE_NEWUTS,
|
||||
},
|
||||
Cgroups: &cgroups.Cgroup{
|
||||
Name: "docker",
|
||||
Parent: "docker",
|
||||
DeviceAccess: false,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -129,13 +129,11 @@ func (d *driver) Name() string {
|
|||
func (d *driver) GetPidsForContainer(id string) ([]int, error) {
|
||||
pids := []int{}
|
||||
|
||||
subsystem := "cpu"
|
||||
subsystem := "devices"
|
||||
cgroupRoot, err := cgroups.FindCgroupMountpoint(subsystem)
|
||||
if err != nil {
|
||||
return pids, err
|
||||
}
|
||||
cgroupRoot = filepath.Dir(cgroupRoot)
|
||||
|
||||
cgroupDir, err := cgroups.GetThisCgroupDir(subsystem)
|
||||
if err != nil {
|
||||
return pids, err
|
||||
|
@ -252,6 +250,7 @@ func createContainer(c *execdriver.Command) *libcontainer.Container {
|
|||
},
|
||||
}
|
||||
}
|
||||
container.Cgroups.Name = c.ID
|
||||
if c.Privileged {
|
||||
container.Capabilities = nil
|
||||
container.Cgroups.DeviceAccess = true
|
||||
|
|
Loading…
Add table
Reference in a new issue