diff --git a/cmd/hecate/main.go b/cmd/hecate/main.go index 327666a..67a4ddc 100644 --- a/cmd/hecate/main.go +++ b/cmd/hecate/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "errors" "flag" "fmt" "log" @@ -147,7 +148,10 @@ func runDaemon(logger *log.Logger, args []string) error { d := service.NewDaemon(cfg, orch, targets, logger) ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) defer stop() - return d.Run(ctx) + if err := d.Run(ctx); err != nil && !errors.Is(err, context.Canceled) { + return err + } + return nil } func runStatus(logger *log.Logger, args []string) error {