* Buffer the signal channel as it's non-blocking on the sender side
* Notify on SIGTERM instead of the uncatchable SIGKILL
License: MIT
Signed-off-by: Filippo Valsorda <valsorda@google.com>
"os/signal"
"runtime"
"strconv"
+ "syscall"
)
const (
logger.Info.Println("Device started")
errs := make(chan error)
- term := make(chan os.Signal)
+ term := make(chan os.Signal, 1)
uapi, err := UAPIListen(interfaceName, fileUAPI)
if err != nil {
// wait for program to terminate
- signal.Notify(term, os.Kill)
+ signal.Notify(term, syscall.SIGTERM)
signal.Notify(term, os.Interrupt)
select {