Skip to content

Commit 10faccf

Browse files
committed
Do not forward SIGURG to the child process
Since go 1.14, SIGURG is emitted internally by the fo runtime, see: - golang/go#37942 - https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md#other-considerations "Choosing a signal" This causes two problems: - This will interfere with processes that use SIGURG for a real purpose (though this is unlikely) - If SIGURG is emitted after the child process has exited but before secrets-init, there will be a spurious error message (see doitintl#16)
1 parent a134c43 commit 10faccf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ func run(ctx context.Context, provider secrets.Provider, commandSlice []string)
230230
// Goroutine for signals forwarding
231231
go func() {
232232
for sig := range sigs {
233-
// ignore SIGCHLD signals since these are only useful for secrets-init
234-
if sig != syscall.SIGCHLD {
233+
// ignore:
234+
// - SIGCHLD signals, since these are only useful for secrets-init
235+
// - SIGURG signals, since they are used internally by the secrets-init
236+
// go runtime (see https://github.com/golang/go/issues/37942) and are of
237+
// no interest to the child process
238+
if sig != syscall.SIGCHLD && sig != syscall.SIGURG {
235239
// forward signal to the main process and its children
236240
e := syscall.Kill(-cmd.Process.Pid, sig.(syscall.Signal))
237241
if e != nil {

0 commit comments

Comments
 (0)