diff --git a/namespaces/exec.go b/namespaces/exec.go index d62b295fe..4783e66f7 100644 --- a/namespaces/exec.go +++ b/namespaces/exec.go @@ -58,8 +58,8 @@ func Exec(container *libcontainer.Config, term Terminal, rootfs, dataPath string } state := &libcontainer.State{ - Pid1: command.Process.Pid, - Pid1StartTime: started, + InitPid: command.Process.Pid, + InitStartTime: started, } if err := libcontainer.SaveState(dataPath, state); err != nil { diff --git a/namespaces/execin.go b/namespaces/execin.go index bbb83e67a..d349282e8 100644 --- a/namespaces/execin.go +++ b/namespaces/execin.go @@ -22,7 +22,7 @@ func ExecIn(container *libcontainer.Config, state *libcontainer.State, args []st } // Enter the namespace and then finish setup - finalArgs := []string{os.Args[0], "nsenter", "--nspid", strconv.Itoa(state.Pid1), "--containerjson", string(containerJson), "--"} + finalArgs := []string{os.Args[0], "nsenter", "--nspid", strconv.Itoa(state.InitPid), "--containerjson", string(containerJson), "--"} finalArgs = append(finalArgs, args...) if err := system.Execv(finalArgs[0], finalArgs[0:], os.Environ()); err != nil { return err diff --git a/state.go b/state.go index 1f05d4c07..b60b901cc 100644 --- a/state.go +++ b/state.go @@ -8,10 +8,10 @@ import ( // State represents a running container's state type State struct { - // Pid1 is the process id for the container's pid 1 in it's parent namespace - Pid1 int `json:"pid1,omitempty"` - // Pid1StartTime is the process start time for the container's pid 1 - Pid1StartTime string `json:"pid1_start_time,omitempty"` + // InitPid is the init process id in the parent namespace + InitPid int `json:"init_pid,omitempty"` + // InitStartTime is the init process start time + InitStartTime string `json:"init_start_time,omitempty"` } // SaveState writes the container's runtime state to a state.json file