зеркало из https://github.com/microsoft/docker.git
Catch SIGQUIT for cleanup
This commit is contained in:
Родитель
0d3f4017cf
Коммит
db7c55ba7f
|
@ -38,7 +38,7 @@ func init() {
|
|||
|
||||
// jobInitApi runs the remote api server `srv` as a daemon,
|
||||
// Only one api server can run at the same time - this is enforced by a pidfile.
|
||||
// The signals SIGINT and SIGTERM are intercepted for cleanup.
|
||||
// The signals SIGINT, SIGQUIT and SIGTERM are intercepted for cleanup.
|
||||
func jobInitApi(job *engine.Job) string {
|
||||
job.Logf("Creating server")
|
||||
srv, err := NewServer(job.Eng, ConfigFromJob(job))
|
||||
|
@ -53,7 +53,7 @@ func jobInitApi(job *engine.Job) string {
|
|||
}
|
||||
job.Logf("Setting up signal traps")
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, os.Signal(syscall.SIGTERM))
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT)
|
||||
go func() {
|
||||
sig := <-c
|
||||
log.Printf("Received signal '%v', exiting\n", sig)
|
||||
|
|
Загрузка…
Ссылка в новой задаче