summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/start.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/start.go b/cmd/podman/start.go
index 00d153904..8f6fc5800 100644
--- a/cmd/podman/start.go
+++ b/cmd/podman/start.go
@@ -96,6 +96,14 @@ func startCmd(c *cli.Context) error {
inputStream = nil
}
+ ctrState, err := ctr.State()
+ if err != nil {
+ return errors.Wrapf(err, "unable to get container state")
+ }
+ if ctrState == libpod.ContainerStateRunning {
+ return attachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.String("detach-keys"), c.BoolT("sig-proxy"))
+ }
+
if err := startAttachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.String("detach-keys"), c.Bool("sig-proxy")); err != nil {
return errors.Wrapf(err, "unable to start container %s", ctr.ID())
}