From cd73a6904d3dc91f305c7415ab7bada8a976d815 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Sun, 4 Mar 2018 12:24:56 -0500 Subject: 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 --- cmd/podman/run.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'cmd/podman/run.go') 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 { -- cgit v1.2.3-54-g00ecf