From 77af09efd6161668d38d0f9efb0c14d40a321f4a Mon Sep 17 00:00:00 2001 From: Rajasekaran Date: Mon, 31 Aug 2015 21:58:14 +0530 Subject: [PATCH] Restorefixforrunningcontainer Signed-off-by: Rajasekaran --- restore.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/restore.go b/restore.go index 8f4a71a64..951297368 100644 --- a/restore.go +++ b/restore.go @@ -3,6 +3,7 @@ package main import ( + "fmt" "os" "path/filepath" @@ -59,6 +60,13 @@ func restoreContainer(context *cli.Context, spec *specs.LinuxSpec, config *confi } } options := criuOptions(context) + status, err := container.Status() + if err != nil { + logrus.Error(err) + } + if status == libcontainer.Running { + fatal(fmt.Errorf("Container with id %s already running", context.GlobalString("id"))) + } // ensure that the container is always removed if we were the process // that created it. defer func() {