@@ -16,9 +16,7 @@ const signalBufferSize = 2048
16
16
17
17
// newSignalHandler returns a signal handler for processing SIGCHLD and SIGWINCH signals
18
18
// while still forwarding all other signals to the process.
19
- // If notifySocket is present, use it to read systemd notifications from the container and
20
- // forward them to notifySocketHost.
21
- func newSignalHandler (enableSubreaper bool , notifySocket * notifySocket ) chan * signalHandler {
19
+ func newSignalHandler (enableSubreaper bool ) chan * signalHandler {
22
20
if enableSubreaper {
23
21
// set us as the subreaper before registering the signal handler for the container
24
22
if err := system .SetSubreaper (1 ); err != nil {
@@ -37,8 +35,7 @@ func newSignalHandler(enableSubreaper bool, notifySocket *notifySocket) chan *si
37
35
// handle all signals for the process.
38
36
signal .Notify (s )
39
37
handler <- & signalHandler {
40
- signals : s ,
41
- notifySocket : notifySocket ,
38
+ signals : s ,
42
39
}
43
40
}()
44
41
return handler
@@ -52,16 +49,15 @@ type exit struct {
52
49
}
53
50
54
51
type signalHandler struct {
55
- signals chan os.Signal
56
- notifySocket * notifySocket
52
+ signals chan os.Signal
57
53
}
58
54
59
55
// forward handles the main signal event loop forwarding, resizing, or reaping depending
60
56
// on the signal received.
61
57
func (h * signalHandler ) forward (process * libcontainer.Process , tty * tty , detach bool ) (int , error ) {
62
58
// make sure we know the pid of our main process so that we can return
63
59
// after it dies.
64
- if detach && h . notifySocket == nil {
60
+ if detach {
65
61
return 0 , nil
66
62
}
67
63
@@ -70,15 +66,6 @@ func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach
70
66
return - 1 , err
71
67
}
72
68
73
- if h .notifySocket != nil {
74
- if detach {
75
- _ = h .notifySocket .run (pid1 )
76
- return 0 , nil
77
- }
78
- _ = h .notifySocket .run (os .Getpid ())
79
- go func () { _ = h .notifySocket .run (0 ) }()
80
- }
81
-
82
69
// Perform the initial tty resize. Always ignore errors resizing because
83
70
// stdout might have disappeared (due to races with when SIGHUP is sent).
84
71
_ = tty .resize ()
0 commit comments