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/start.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cmd/podman/start.go') diff --git a/cmd/podman/start.go b/cmd/podman/start.go index c90fab645..366d5c3fc 100644 --- a/cmd/podman/start.go +++ b/cmd/podman/start.go @@ -25,6 +25,10 @@ var ( Name: "interactive, i", Usage: "Keep STDIN open even if not attached", }, + cli.BoolFlag{ + Name: "sig-proxy", + Usage: "proxy received signals to the process", + }, LatestFlag, } startDescription = ` @@ -60,6 +64,10 @@ func startCmd(c *cli.Context) error { return err } + if c.Bool("sig-proxy") && !attach { + return errors.Wrapf(libpod.ErrInvalidArg, "you cannot use sig-proxy without --attach") + } + runtime, err := getRuntime(c) if err != nil { return errors.Wrapf(err, "error creating libpod runtime") @@ -106,6 +114,10 @@ func startCmd(c *cli.Context) error { return errors.Wrapf(err, "unable to start container %s", ctr.ID()) } + if c.Bool("sig-proxy") { + ProxySignals(ctr) + } + // Wait for attach to complete err = <-attachChan if err != nil { -- cgit v1.2.3-54-g00ecf