Bring in some updates from the signal handling code in other projects: - Rename `signals` to more descriptive `interruptSignals`. - Add SIGHUP to unix shutdown signals. Rename `signalsigterm.go` to `signal_unix.go` accordingly. - Include extra detail in "Already shutting down..." messages log lines. - Pass a shutdown func into `webapi.go` rather than a channel. It's more obvious how to invoke a func, whereas a channel can be used in multiple ways.
22 lines
403 B
Go
22 lines
403 B
Go
// Copyright (c) 2016 The btcsuite developers
|
|
// Copyright (c) 2021 The Decred developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func init() {
|
|
interruptSignals = []os.Signal{
|
|
os.Interrupt,
|
|
syscall.SIGTERM,
|
|
syscall.SIGHUP,
|
|
}
|
|
}
|