1
0
Fork 0
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:
Michael Crosby 2014-02-24 16:35:11 -08:00
parent 9bf6cb2692
commit 9f03fd76b5

View file

@ -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 {