Skip to content

Commit 941a6d0

Browse files
committed
pkg/signal: ignore SIGTOP for signal proxy
It makes no sense to forward it, SIGSTOP cannot be handled by userspace (like SIGKILL) and it didn't do anything before so this just makes it more explicit. Signed-off-by: Paul Holzinger <[email protected]>
1 parent a4d0067 commit 941a6d0

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

pkg/signal/signal_linux.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,11 @@ func isSignalIgnoredBySigProxy(s syscall.Signal) bool {
9494
// Ignore SIGCHLD and SIGPIPE - these are most likely intended for the podman command itself.
9595
// SIGURG was added because of golang 1.14 and its preemptive changes causing more signals to "show up".
9696
// https://github.com/containers/podman/issues/5483
97-
return s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG
97+
// SIGSTOP cannot be ignored/forwarded by userspace.
98+
switch s {
99+
case syscall.SIGCHLD, syscall.SIGPIPE, syscall.SIGURG, syscall.SIGSTOP:
100+
return true
101+
default:
102+
return false
103+
}
98104
}

pkg/signal/signal_linux_mipsx.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,11 @@ func isSignalIgnoredBySigProxy(s syscall.Signal) bool {
9494
// Ignore SIGCHLD and SIGPIPE - these are most likely intended for the podman command itself.
9595
// SIGURG was added because of golang 1.14 and its preemptive changes causing more signals to "show up".
9696
// https://github.com/containers/podman/issues/5483
97-
return s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG
97+
// SIGSTOP cannot be ignored/forwarded by userspace.
98+
switch s {
99+
case syscall.SIGCHLD, syscall.SIGPIPE, syscall.SIGURG, syscall.SIGSTOP:
100+
return true
101+
default:
102+
return false
103+
}
98104
}

pkg/signal/signal_unix.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,11 @@ func isSignalIgnoredBySigProxy(s syscall.Signal) bool {
9292
// Ignore SIGCHLD and SIGPIPE - these are most likely intended for the podman command itself.
9393
// SIGURG was added because of golang 1.14 and its preemptive changes causing more signals to "show up".
9494
// https://github.com/containers/podman/issues/5483
95-
return s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG
95+
// SIGSTOP cannot be ignored/forwarded by userspace.
96+
switch s {
97+
case syscall.SIGCHLD, syscall.SIGPIPE, syscall.SIGURG, syscall.SIGSTOP:
98+
return true
99+
default:
100+
return false
101+
}
96102
}

0 commit comments

Comments
 (0)