new-api: set Cloneflags in namespace.Exec()
This place looks more suitable. Signed-off-by: Andrey Vagin <avagin@openvz.org>
This commit is contained in:
parent
d572094b75
commit
195a08efbc
|
@ -133,8 +133,6 @@ func (c *linuxContainer) updateStateFile() error {
|
|||
}
|
||||
|
||||
func (c *linuxContainer) startInitProcess(cmd *exec.Cmd, config *ProcessConfig) error {
|
||||
cmd.SysProcAttr.Cloneflags = uintptr(namespaces.GetNamespaceFlags(c.config.Namespaces))
|
||||
|
||||
err := namespaces.Exec(config.Args, config.Env, cmd, c.config, c.state)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -31,9 +31,10 @@ func Exec(args []string, env []string, command *exec.Cmd, container *configs.Con
|
|||
return err
|
||||
}
|
||||
defer parent.Close()
|
||||
|
||||
command.ExtraFiles = []*os.File{child}
|
||||
|
||||
command.Dir = container.RootFs
|
||||
command.SysProcAttr.Cloneflags = uintptr(GetNamespaceFlags(container.Namespaces))
|
||||
|
||||
if err := command.Start(); err != nil {
|
||||
child.Close()
|
||||
|
|
Loading…
Reference in New Issue