Skip to content

Commit

Permalink
sigtrap: always ignore SIGPIPE (#6645)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored Oct 19, 2024
1 parent 388c7e8 commit b443190
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sigtrap_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import (

// trapSignalsPosix captures POSIX-only signals.
func trapSignalsPosix() {
// Ignore all SIGPIPE signals to prevent weird issues with systemd: https://github.com/dunglas/frankenphp/issues/1020
// Docker/Moby has a similar hack: https://github.com/moby/moby/blob/d828b032a87606ae34267e349bf7f7ccb1f6495a/cmd/dockerd/docker.go#L87-L90
signal.Ignore(syscall.SIGPIPE)

go func() {
sigchan := make(chan os.Signal, 1)
signal.Notify(sigchan, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGUSR1, syscall.SIGUSR2)
Expand Down

0 comments on commit b443190

Please # to comment.