Skip to content

Commit 015bdb7

Browse files
authored
Merge pull request #2188 from crosbymichael/sigpiper
[release 1.0] Handle SIGPIPE in shims
2 parents d18de62 + 592af93 commit 015bdb7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

cmd/containerd-shim/main_unix.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ func handleSignals(logger *logrus.Entry, signals chan os.Signal, server *ttrpc.S
192192
sv.Delete(context.Background(), &ptypes.Empty{})
193193
close(done)
194194
})
195+
case unix.SIGPIPE:
195196
}
196197
}
197198
}

cmd/containerd-shim/shim_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ package main
33
import (
44
"os"
55
"os/signal"
6-
"syscall"
76

87
"github.com/containerd/containerd/reaper"
98
"github.com/containerd/containerd/sys"
109
runc "github.com/containerd/go-runc"
1110
"github.com/stevvooe/ttrpc"
11+
"golang.org/x/sys/unix"
1212
)
1313

1414
// setupSignals creates a new signal handler for all signals and sets the shim as a
1515
// sub-reaper so that the container processes are reparented
1616
func setupSignals() (chan os.Signal, error) {
1717
signals := make(chan os.Signal, 32)
18-
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT, syscall.SIGCHLD)
18+
signal.Notify(signals, unix.SIGTERM, unix.SIGINT, unix.SIGCHLD, unix.SIGPIPE)
1919
// make sure runc is setup to use the monitor
2020
// for waiting on processes
2121
runc.Monitor = reaper.Default

0 commit comments

Comments
 (0)