diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-03-16 10:34:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-16 10:34:32 -0400 |
commit | d7acfb478e5e5e6ac344d18c1a65ab81996fd8b2 (patch) | |
tree | c1a335e5a2291e8447e8f9f4c4ef02e7cde2fd0c /cmd/podman/start.go | |
parent | 2f533888a5adcbfb57ec22a8086aa5e76acb9071 (diff) | |
parent | cd73a6904d3dc91f305c7415ab7bada8a976d815 (diff) | |
download | podman-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/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 { |