Move rest of cgroups functions into cgroups pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
c4769ec624
commit
ccc915b7b9
3 changed files with 127 additions and 144 deletions
|
@ -5,7 +5,6 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"github.com/dotcloud/docker/pkg/libcontainer"
|
||||
"github.com/dotcloud/docker/pkg/libcontainer/cgroup"
|
||||
"github.com/dotcloud/docker/pkg/libcontainer/network"
|
||||
"github.com/dotcloud/docker/pkg/libcontainer/utils"
|
||||
"github.com/dotcloud/docker/pkg/system"
|
||||
|
@ -41,9 +40,11 @@ func execCommand(container *libcontainer.Container, args []string) (int, error)
|
|||
|
||||
// Do this before syncing with child so that no children
|
||||
// can escape the cgroup
|
||||
if err := cgroup.ApplyCgroup(container, command.Process.Pid); err != nil {
|
||||
command.Process.Kill()
|
||||
return -1, err
|
||||
if container.Cgroups != nil {
|
||||
if err := container.Cgroups.Apply(command.Process.Pid); err != nil {
|
||||
command.Process.Kill()
|
||||
return -1, err
|
||||
}
|
||||
}
|
||||
|
||||
if container.Network != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue