Skip to content

Commit b443190

Browse files
authored
sigtrap: always ignore SIGPIPE (#6645)
1 parent 388c7e8 commit b443190

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sigtrap_posix.go

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ import (
2828

2929
// trapSignalsPosix captures POSIX-only signals.
3030
func trapSignalsPosix() {
31+
// Ignore all SIGPIPE signals to prevent weird issues with systemd: https://github.com/dunglas/frankenphp/issues/1020
32+
// Docker/Moby has a similar hack: https://github.com/moby/moby/blob/d828b032a87606ae34267e349bf7f7ccb1f6495a/cmd/dockerd/docker.go#L87-L90
33+
signal.Ignore(syscall.SIGPIPE)
34+
3135
go func() {
3236
sigchan := make(chan os.Signal, 1)
3337
signal.Notify(sigchan, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGUSR1, syscall.SIGUSR2)

0 commit comments

Comments
 (0)