Merge pull request #239 from rajasec/restore-leaverunning

Restorefixforrunningcontainer
This commit is contained in:
Mrunal Patel
2015-09-02 11:21:30 -07:00
+8
View File
@@ -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() {