Remove SysinitPath from process

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-01-13 15:09:41 -08:00
parent f846ecdc77
commit 1e81387edc
3 changed files with 23 additions and 24 deletions

View file

@ -675,18 +675,17 @@ func (container *Container) Start() (err error) {
} }
container.process = &execdriver.Process{ container.process = &execdriver.Process{
ID: container.ID, ID: container.ID,
Privileged: container.hostConfig.Privileged, Privileged: container.hostConfig.Privileged,
Rootfs: root, Rootfs: root,
InitPath: "/.dockerinit", InitPath: "/.dockerinit",
Entrypoint: container.Path, Entrypoint: container.Path,
Arguments: container.Args, Arguments: container.Args,
WorkingDir: workingDir, WorkingDir: workingDir,
ConfigPath: container.lxcConfigPath(), ConfigPath: container.lxcConfigPath(),
Network: en, Network: en,
Tty: container.Config.Tty, Tty: container.Config.Tty,
User: container.Config.User, User: container.Config.User,
SysInitPath: runtime.sysInitPath,
} }
container.process.SysProcAttr = &syscall.SysProcAttr{Setsid: true} container.process.SysProcAttr = &syscall.SysProcAttr{Setsid: true}

View file

@ -29,18 +29,17 @@ type Network struct {
type Process struct { type Process struct {
exec.Cmd exec.Cmd
ID string ID string
Privileged bool Privileged bool
User string User string
Rootfs string // root fs of the container Rootfs string // root fs of the container
InitPath string // dockerinit InitPath string // dockerinit
Entrypoint string Entrypoint string
Arguments []string Arguments []string
WorkingDir string WorkingDir string
ConfigPath string ConfigPath string
Tty bool Tty bool
Network *Network // if network is nil then networking is disabled Network *Network // if network is nil then networking is disabled
SysInitPath string
} }
func (c *Process) Pid() int { func (c *Process) Pid() int {

View file

@ -256,6 +256,7 @@ func linkLxcStart(root string) error {
return os.Symlink(sourcePath, targetPath) return os.Symlink(sourcePath, targetPath)
} }
// TODO: This can be moved to the mountinfo reader in the mount pkg
func rootIsShared() bool { func rootIsShared() bool {
if data, err := ioutil.ReadFile("/proc/self/mountinfo"); err == nil { if data, err := ioutil.ReadFile("/proc/self/mountinfo"); err == nil {
for _, line := range strings.Split(string(data), "\n") { for _, line := range strings.Split(string(data), "\n") {