Add container start and supervisor
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
e620833c9e
commit
21a53c1d70
11 changed files with 380 additions and 139 deletions
|
@ -7,20 +7,26 @@ import (
|
|||
"github.com/docker/containerd/execution"
|
||||
)
|
||||
|
||||
func newProcess(pid int) (execution.Process, error) {
|
||||
func newProcess(id string, pid int) (execution.Process, error) {
|
||||
proc, err := os.FindProcess(pid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &process{
|
||||
id: id,
|
||||
proc: proc,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type process struct {
|
||||
id string
|
||||
proc *os.Process
|
||||
}
|
||||
|
||||
func (p *process) ID() string {
|
||||
return p.id
|
||||
}
|
||||
|
||||
func (p *process) Pid() int {
|
||||
return p.proc.Pid
|
||||
}
|
||||
|
@ -30,6 +36,7 @@ func (p *process) Wait() (uint32, error) {
|
|||
if err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
// TODO: implement kill-all if we are the init pid
|
||||
return uint32(state.Sys().(syscall.WaitStatus).ExitStatus()), nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue