From dce70cdff53f576e1334de2a545326599ec824a6 Mon Sep 17 00:00:00 2001 From: Ace-Tang Date: Mon, 3 Dec 2018 13:31:20 +0800 Subject: [PATCH] cr: get pid from criu notify when restore when restore container from a checkpoint directory, we should get pid from criu notify, since c.initProcess has not been created. Signed-off-by: Ace-Tang --- libcontainer/container_linux.go | 1 + 1 file changed, 1 insertion(+) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index b1a2e221364..3113e875396 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -1554,6 +1554,7 @@ func (c *linuxContainer) criuNotifications(resp *criurpc.CriuResp, process *Proc if err != nil { return nil } + s.Pid = int(notify.GetPid()) for i, hook := range c.config.Hooks.Prestart { if err := hook.Run(s); err != nil { return newSystemErrorWithCausef(err, "running prestart hook %d", i)