mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update close fd issues for lxc
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
This commit is contained in:
parent
d31ae5aed8
commit
707ef9618b
2 changed files with 9 additions and 7 deletions
|
@ -19,7 +19,6 @@ import (
|
||||||
"github.com/docker/libcontainer/label"
|
"github.com/docker/libcontainer/label"
|
||||||
"github.com/docker/libcontainer/mount/nodes"
|
"github.com/docker/libcontainer/mount/nodes"
|
||||||
"github.com/dotcloud/docker/daemon/execdriver"
|
"github.com/dotcloud/docker/daemon/execdriver"
|
||||||
"github.com/dotcloud/docker/pkg/system"
|
|
||||||
"github.com/dotcloud/docker/utils"
|
"github.com/dotcloud/docker/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,12 +36,6 @@ func init() {
|
||||||
if err := setupNetworking(args); err != nil {
|
if err := setupNetworking(args); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := setupWorkingDirectory(args); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := system.CloseFdsFrom(3); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := finalizeNamespace(args); err != nil {
|
if err := finalizeNamespace(args); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
"github.com/docker/libcontainer/namespaces"
|
"github.com/docker/libcontainer/namespaces"
|
||||||
"github.com/docker/libcontainer/security/capabilities"
|
"github.com/docker/libcontainer/security/capabilities"
|
||||||
|
"github.com/docker/libcontainer/utils"
|
||||||
"github.com/dotcloud/docker/daemon/execdriver"
|
"github.com/dotcloud/docker/daemon/execdriver"
|
||||||
"github.com/dotcloud/docker/daemon/execdriver/native/template"
|
"github.com/dotcloud/docker/daemon/execdriver/native/template"
|
||||||
"github.com/dotcloud/docker/pkg/system"
|
"github.com/dotcloud/docker/pkg/system"
|
||||||
|
@ -18,6 +19,10 @@ func setHostname(hostname string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func finalizeNamespace(args *execdriver.InitArgs) error {
|
func finalizeNamespace(args *execdriver.InitArgs) error {
|
||||||
|
if err := utils.CloseExecFrom(3); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// We use the native drivers default template so that things like caps are consistent
|
// We use the native drivers default template so that things like caps are consistent
|
||||||
// across both drivers
|
// across both drivers
|
||||||
container := template.New()
|
container := template.New()
|
||||||
|
@ -49,5 +54,9 @@ func finalizeNamespace(args *execdriver.InitArgs) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := setupWorkingDirectory(args); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue