package main import ( "log" "os" "os/signal" "syscall" "xengineering.eu/ceres/model" ) func main() { model.InitStorage() defer model.RemoveStorage() model.InitDatabase() defer model.CloseDatabase() listener := make(chan os.Signal) signal.Notify(listener, syscall.SIGTERM) signal.Notify(listener, syscall.SIGINT) sig := <-listener log.Printf("Cleaning up due to OS signal '%v'\n", sig) }