mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix restore container by nspid
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
9bf6cb2692
commit
9f03fd76b5
1 changed files with 18 additions and 1 deletions
|
@ -112,7 +112,24 @@ func (d *driver) Kill(p *execdriver.Command, sig int) error {
|
|||
}
|
||||
|
||||
func (d *driver) Restore(c *execdriver.Command) error {
|
||||
return ErrNotSupported
|
||||
var (
|
||||
nspid int
|
||||
p = filepath.Join(d.root, "containers", c.ID, "root", ".nspid")
|
||||
)
|
||||
f, err := os.Open(p)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
if _, err := fmt.Fscanf(f, "%d", &nspid); err != nil {
|
||||
return err
|
||||
}
|
||||
proc, err := os.FindProcess(nspid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = proc.Wait()
|
||||
return err
|
||||
}
|
||||
|
||||
func (d *driver) Info(id string) execdriver.Info {
|
||||
|
|
Loading…
Add table
Reference in a new issue