summaryrefslogtreecommitdiff
path: root/cmd/podman/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r--cmd/podman/run.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index 10f68e9da..0c174a729 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -108,16 +108,6 @@ func runCmd(c *cli.Context) error {
logrus.Debugf("container %q has CgroupParent %q", ctr.ID(), p)
}
- if err := ctr.Init(); err != nil {
- // This means the command did not exist
- exitCode = 127
- if strings.Index(err.Error(), "permission denied") > -1 {
- exitCode = 126
- }
- return err
- }
- logrus.Debugf("container storage created for %q", ctr.ID())
-
createConfigJSON, err := json.Marshal(createConfig)
if err != nil {
return err
@@ -135,7 +125,12 @@ func runCmd(c *cli.Context) error {
// Handle detached start
if createConfig.Detach {
if err := ctr.Start(); err != nil {
- return errors.Wrapf(err, "unable to start container %q", ctr.ID())
+ // This means the command did not exist
+ exitCode = 127
+ if strings.Index(err.Error(), "permission denied") > -1 {
+ exitCode = 126
+ }
+ return err
}
fmt.Printf("%s\n", ctr.ID())
@@ -147,7 +142,12 @@ func runCmd(c *cli.Context) error {
// Handle this when we split streams to allow attaching just stdin/out/err
attachChan, err := ctr.StartAndAttach(false, c.String("detach-keys"))
if err != nil {
- return errors.Wrapf(err, "unable to start container %q", ctr.ID())
+ // This means the command did not exist
+ exitCode = 127
+ if strings.Index(err.Error(), "permission denied") > -1 {
+ exitCode = 126
+ }
+ return err
}
if c.BoolT("sig-proxy") {