whprintf/signals.go

20 lines
262 B
Go
Raw Normal View History

2021-10-14 18:27:22 +03:00
package main
import (
"log"
"os"
"os/signal"
"syscall"
)
func processSignals() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
for {
<-c
log.Println("Quitting...")
os.Exit(0)
}
}