summaryrefslogtreecommitdiff
path: root/cmd/podman/run.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-03-16 10:34:32 -0400
committerGitHub <noreply@github.com>2018-03-16 10:34:32 -0400
commitd7acfb478e5e5e6ac344d18c1a65ab81996fd8b2 (patch)
treec1a335e5a2291e8447e8f9f4c4ef02e7cde2fd0c /cmd/podman/run.go
parent2f533888a5adcbfb57ec22a8086aa5e76acb9071 (diff)
parentcd73a6904d3dc91f305c7415ab7bada8a976d815 (diff)
downloadpodman-d7acfb478e5e5e6ac344d18c1a65ab81996fd8b2.tar.gz
podman-d7acfb478e5e5e6ac344d18c1a65ab81996fd8b2.tar.bz2
podman-d7acfb478e5e5e6ac344d18c1a65ab81996fd8b2.zip
Merge pull request #447 from mheon/sig_proxy
Add signal proxying to podman run and attach
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r--cmd/podman/run.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index f68db9036..7b840a387 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -13,11 +13,16 @@ import (
var runDescription = "Runs a command in a new container from the given image"
+var runFlags []cli.Flag = append(createFlags, cli.BoolTFlag{
+ Name: "sig-proxy",
+ Usage: "proxy received signals to the process (default true)",
+})
+
var runCommand = cli.Command{
Name: "run",
Usage: "run a command in a new container",
Description: runDescription,
- Flags: createFlags,
+ Flags: runFlags,
Action: runCmd,
ArgsUsage: "IMAGE [COMMAND [ARG...]]",
SkipArgReorder: true,
@@ -133,6 +138,10 @@ func runCmd(c *cli.Context) error {
return errors.Wrapf(err, "unable to start container %q", ctr.ID())
}
+ if c.BoolT("sig-proxy") {
+ ProxySignals(ctr)
+ }
+
// Wait for attach to complete
err = <-attachChan
if err != nil {