diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-22 17:06:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-22 17:06:45 +0200 |
commit | 8bf3535447fe9f482b329e962e173ade26456e6d (patch) | |
tree | 39375c55d8bda145631c4d739fdf3013945b8ad1 /pkg/domain/infra/abi | |
parent | 828fae12971c5a7b9807c8c4f8e029fe5d0ddc2f (diff) | |
parent | 7cfe0328f1c231ed318c38938479f7dec7fc97fa (diff) | |
download | podman-8bf3535447fe9f482b329e962e173ade26456e6d.tar.gz podman-8bf3535447fe9f482b329e962e173ade26456e6d.tar.bz2 podman-8bf3535447fe9f482b329e962e173ade26456e6d.zip |
Merge pull request #15131 from boaz0/closes_14707
Add support to sig-proxy for podman-remote
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/terminal/sigproxy_commn.go | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/pkg/domain/infra/abi/terminal/sigproxy_commn.go b/pkg/domain/infra/abi/terminal/sigproxy_commn.go index 3a0132ef3..d42685508 100644 --- a/pkg/domain/infra/abi/terminal/sigproxy_commn.go +++ b/pkg/domain/infra/abi/terminal/sigproxy_commn.go @@ -15,33 +15,25 @@ import ( "github.com/sirupsen/logrus" ) -// Make sure the signal buffer is sufficiently big. -// runc is using the same value. -const signalBufferSize = 2048 - // ProxySignals ... func ProxySignals(ctr *libpod.Container) { // Stop catching the shutdown signals (SIGINT, SIGTERM) - they're going // to the container now. shutdown.Stop() //nolint: errcheck - sigBuffer := make(chan os.Signal, signalBufferSize) + sigBuffer := make(chan os.Signal, signal.SignalBufferSize) signal.CatchAll(sigBuffer) logrus.Debugf("Enabling signal proxying") go func() { for s := range sigBuffer { - // Ignore SIGCHLD and SIGPIPE - these are mostly likely - // intended for the podman command itself. - // SIGURG was added because of golang 1.14 and its preemptive changes - // causing more signals to "show up". - // https://github.com/containers/podman/issues/5483 - if s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG { + syscallSignal := s.(syscall.Signal) + if signal.IsSignalIgnoredBySigProxy(syscallSignal) { continue } - if err := ctr.Kill(uint(s.(syscall.Signal))); err != nil { + if err := ctr.Kill(uint(syscallSignal)); err != nil { if errors.Is(err, define.ErrCtrStateInvalid) { logrus.Infof("Ceasing signal forwarding to container %s as it has stopped", ctr.ID()) } else { |