Skip to content

Commit

Permalink
Merge pull request #239 from rajasec/restore-leaverunning
Browse files Browse the repository at this point in the history
Restorefixforrunningcontainer
  • Loading branch information
Mrunal Patel committed Sep 2, 2015
2 parents 05b1cda + 77af09e commit 0f85e4e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package main

import (
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 0f85e4e

Please sign in to comment.