[service] Add utility module to manage services

This commit is contained in:
cyrilix committed 2019-12-27 16:43:04 +01:00
1 parent e35d6f1381
commit 47d48c39b0
2 files changed
+35 -6

No files matched your search

+2 -6
View File
@@ -3,6 +3,7 @@ package cli
import (
"flag"
"fmt"
"github.com/cyrilix/robocar-base/service"
MQTT "github.com/eclipse/paho.mqtt.golang"
"log"
"os"
@@ -49,12 +50,7 @@ func SetFloat64DefaultValueFromEnv(value *float64, key string, defaultValue floa
return nil
}
type Part interface {
Start() error
Stop()
}
func HandleExit(p Part) {
func HandleExit(p service.Part) {
signals := make(chan os.Signal, 1)
signal.Notify(signals, os.Kill, os.Interrupt, syscall.SIGTERM)