Check container status for start call

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-05-17 10:25:28 -07:00
parent 88dcf1d686
commit 60f5df6e09
1 changed files with 8 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"syscall"
"github.com/codegangsta/cli"
"github.com/opencontainers/runc/libcontainer"
)
var startCommand = cli.Command{
@ -20,8 +21,14 @@ your host.`,
if err != nil {
fatal(err)
}
if err := container.Signal(syscall.SIGCONT); err != nil {
status, err := container.Status()
if err != nil {
fatal(err)
}
if status == libcontainer.Created {
if err := container.Signal(syscall.SIGCONT); err != nil {
fatal(err)
}
}
},
}