Skip to content

Commit 62331df

Browse files
committed
fix: Don't attempt to catch SIGQUIT or SIGKILL
SIGKILL can't be caught so there's no point in trying. SIGQUIT is intended as a harsh exit for debugging purposes; it should generate a core dump that accurately depicts the program's state at the time the SIGQUIT was received.
1 parent 8f6e9ad commit 62331df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/generator/generator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func (g *generator) generateFromSignals() {
110110
switch sig {
111111
case syscall.SIGHUP:
112112
g.generateFromContainers()
113-
case syscall.SIGQUIT, syscall.SIGKILL, syscall.SIGTERM, syscall.SIGINT:
113+
case syscall.SIGTERM, syscall.SIGINT:
114114
// exit when context is done
115115
return
116116
}
@@ -164,7 +164,7 @@ func (g *generator) generateAtInterval() {
164164
case sig := <-sigChan:
165165
log.Printf("Received signal: %s\n", sig)
166166
switch sig {
167-
case syscall.SIGQUIT, syscall.SIGKILL, syscall.SIGTERM, syscall.SIGINT:
167+
case syscall.SIGTERM, syscall.SIGINT:
168168
ticker.Stop()
169169
return
170170
}
@@ -296,7 +296,7 @@ func (g *generator) generateFromEvents() {
296296
case sig := <-sigChan:
297297
log.Printf("Received signal: %s\n", sig)
298298
switch sig {
299-
case syscall.SIGQUIT, syscall.SIGKILL, syscall.SIGTERM, syscall.SIGINT:
299+
case syscall.SIGTERM, syscall.SIGINT:
300300
// close all watchers and exit
301301
for _, watcher := range watchers {
302302
close(watcher)
@@ -471,7 +471,7 @@ func (g *generator) getContainers() ([]*context.RuntimeContainer, error) {
471471

472472
func newSignalChannel() <-chan os.Signal {
473473
sig := make(chan os.Signal, 1)
474-
signal.Notify(sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
474+
signal.Notify(sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM)
475475

476476
return sig
477477
}

0 commit comments

Comments
 (0)