diff --git a/opencloud/pkg/runtime/service/service.go b/opencloud/pkg/runtime/service/service.go index 7fcef40076..a8885ea9e7 100644 --- a/opencloud/pkg/runtime/service/service.go +++ b/opencloud/pkg/runtime/service/service.go @@ -433,7 +433,7 @@ func Start(ctx context.Context, o ...Option) error { // go supervisor.Serve() // because that will briefly create a race condition as it starts up, if you try to .Add() services immediately afterward. // https://pkg.go.dev/github.com/thejerf/suture/v4@v4.0.0#Supervisor - go s.Supervisor.ServeBackground(ctx) + go s.Supervisor.ServeBackground(context.Background()) for i, service := range s.Services { scheduleServiceTokens(s, service) diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index 342036167e..27f772c3f4 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -91,7 +91,9 @@ func Server(cfg *config.Config) *cobra.Command { gr.Add(runner.New(cfg.Service.Name+".svc", func() error { return natsServer.ListenAndServe() }, func() { + logger.Info().Msg("Gracefully shutting down the NATS server...") natsServer.Shutdown() + logger.Info().Msg("NATS server shutdown") })) grResults := gr.Run(ctx)