summaryrefslogtreecommitdiff
path: root/pkg/adapter/sigproxy_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/adapter/sigproxy_linux.go')
-rw-r--r--pkg/adapter/sigproxy_linux.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkg/adapter/sigproxy_linux.go b/pkg/adapter/sigproxy_linux.go
index ebfeab725..5695d0e42 100644
--- a/pkg/adapter/sigproxy_linux.go
+++ b/pkg/adapter/sigproxy_linux.go
@@ -5,7 +5,7 @@ import (
"syscall"
"github.com/containers/libpod/libpod"
- "github.com/docker/docker/pkg/signal"
+ "github.com/containers/libpod/pkg/signal"
"github.com/sirupsen/logrus"
)
@@ -20,16 +20,25 @@ func ProxySignals(ctr *libpod.Container) {
for s := range sigBuffer {
// Ignore SIGCHLD and SIGPIPE - these are mostly likely
// intended for the podman command itself.
- if s == signal.SIGCHLD || s == signal.SIGPIPE {
+ // SIGURG was added because of golang 1.14 and its preemptive changes
+ // causing more signals to "show up".
+ // https://github.com/containers/libpod/issues/5483
+ if s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG {
continue
}
if err := ctr.Kill(uint(s.(syscall.Signal))); err != nil {
+ // If the container dies, and we find out here,
+ // we need to forward that one signal to
+ // ourselves so that it is not lost, and then
+ // we terminate the proxy and let the defaults
+ // play out.
logrus.Errorf("Error forwarding signal %d to container %s: %v", s, ctr.ID(), err)
signal.StopCatch(sigBuffer)
if err := syscall.Kill(syscall.Getpid(), s.(syscall.Signal)); err != nil {
logrus.Errorf("failed to kill pid %d", syscall.Getpid())
}
+ return
}
}
}()