github.com/torfuzx/docker@v1.8.1/daemon/debugtrap_unix.go (about)

     1  // +build !windows
     2  
     3  package daemon
     4  
     5  import (
     6  	"os"
     7  	"os/signal"
     8  	"syscall"
     9  
    10  	psignal "github.com/docker/docker/pkg/signal"
    11  )
    12  
    13  func setupDumpStackTrap() {
    14  	c := make(chan os.Signal, 1)
    15  	signal.Notify(c, syscall.SIGUSR1)
    16  	go func() {
    17  		for range c {
    18  			psignal.DumpStacks()
    19  		}
    20  	}()
    21  }