1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/debugtrap.go
Phil Estes 95fcf76cc6 Add SIGUSR1 handler for dumping stack/goroutine traces
Add handler for SIGUSR1 based on feedback regarding when to dump
goroutine stacks.  This will also dump goroutine stack traces on SIGQUIT
followed by a hard-exit from the daemon.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-05-12 10:09:23 +10:00

21 lines
281 B
Go

// +build !windows
package daemon
import (
"os"
"os/signal"
"syscall"
psignal "github.com/docker/docker/pkg/signal"
)
func setupSigusr1Trap() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGUSR1)
go func() {
for range c {
psignal.DumpStacks()
}
}()
}