From bce8df549835c996140aa796faf3d896fef2a6a1 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Mon, 4 Jul 2016 04:12:51 -0400 Subject: [PATCH] Fix attach to old running container after restart Get the control pipe of old running container on containerd restarting. Signed-off-by: Lei Jitang --- runtime/process.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/process.go b/runtime/process.go index 10d6a3c69..9915b7dc6 100644 --- a/runtime/process.go +++ b/runtime/process.go @@ -132,6 +132,13 @@ func loadProcess(root, id string, c *container, s *ProcessState) (*process, erro return nil, err } p.exitPipe = exit + + control, err := getControlPipe(filepath.Join(root, ControlFile)) + if err != nil { + return nil, err + } + p.controlPipe = control + return p, nil } return nil, err