aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/run.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-03-04 12:24:56 -0500
committerMatthew Heon <matthew.heon@gmail.com>2018-03-15 16:00:20 -0400
commitcd73a6904d3dc91f305c7415ab7bada8a976d815 (patch)
treef801bda8d9b6eb4726f1c6c41d33cd877d5246ff /cmd/podman/run.go
parent647fedc2a2bc84a3e199ae86d5a7c6608d3968cc (diff)
downloadpodman-cd73a6904d3dc91f305c7415ab7bada8a976d815.tar.gz
podman-cd73a6904d3dc91f305c7415ab7bada8a976d815.tar.bz2
podman-cd73a6904d3dc91f305c7415ab7bada8a976d815.zip
Add signal proxying to podman run, start, and attach
Also removes sig-proxy from 'podman create', where is does not make sense. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
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 {