diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-03-04 12:24:56 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-03-15 16:00:20 -0400 |
commit | cd73a6904d3dc91f305c7415ab7bada8a976d815 (patch) | |
tree | f801bda8d9b6eb4726f1c6c41d33cd877d5246ff /cmd/podman/start.go | |
parent | 647fedc2a2bc84a3e199ae86d5a7c6608d3968cc (diff) | |
download | podman-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/start.go')
-rw-r--r-- | cmd/podman/start.go | 12 |
1 files changed, 12 insertions, 0 deletions
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 { |