diff --git a/ocis/pkg/command/root.go b/ocis/pkg/command/root.go index 666ee0544f..6dd7136e41 100644 --- a/ocis/pkg/command/root.go +++ b/ocis/pkg/command/root.go @@ -28,6 +28,6 @@ func Execute() error { ) } - ctx, _ := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + ctx, _ := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) return app.RunContext(ctx, os.Args) } diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index eac779809d..311d6f7c1e 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -7,10 +7,8 @@ import ( "net/http" "net/rpc" "os" - "os/signal" "sort" "strings" - "syscall" "time" authapp "github.com/owncloud/ocis/v2/services/auth-app/pkg/command" @@ -362,9 +360,8 @@ func Start(ctx context.Context, o ...Option) error { return err } - // halt listens for interrupt signals and blocks. - halt := make(chan os.Signal, 1) - signal.Notify(halt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) + // get a cancel function to stop the service + ctx, cancel := context.WithCancel(ctx) // tolerance controls backoff cycles from the supervisor. tolerance := 5 @@ -376,7 +373,7 @@ func Start(ctx context.Context, o ...Option) error { if e.Type() == suture.EventTypeBackoff { totalBackoff++ if totalBackoff == tolerance { - halt <- os.Interrupt + cancel() } } s.Log.Info().Str("event", e.String()).Msg(fmt.Sprintf("supervisor: %v", e.Map()["supervisor_name"])) @@ -424,8 +421,8 @@ func Start(ctx context.Context, o ...Option) error { // https://pkg.go.dev/github.com/thejerf/suture/v4@v4.0.0#Supervisor go s.Supervisor.ServeBackground(s.context) - // trap will block on halt channel for interruptions. - go trap(s, halt) + // trap will block on context done channel for interruptions. + go trap(s, ctx) for i, service := range s.Services { scheduleServiceTokens(s, service) @@ -508,9 +505,8 @@ func (s *Service) List(_ struct{}, reply *string) error { // trap blocks on halt channel. When the runtime is interrupted it // signals the controller to stop any supervised process. -func trap(s *Service, halt chan os.Signal) { - <-halt - s.cancel() +func trap(s *Service, ctx context.Context) { + <-ctx.Done() for sName := range s.serviceToken { for i := range s.serviceToken[sName] { if err := s.Supervisor.Remove(s.serviceToken[sName][i]); err != nil { diff --git a/services/activitylog/cmd/activitylog/main.go b/services/activitylog/cmd/activitylog/main.go index a8555bd20d..dae55b4f16 100644 --- a/services/activitylog/cmd/activitylog/main.go +++ b/services/activitylog/cmd/activitylog/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/antivirus/cmd/antivirus/main.go b/services/antivirus/cmd/antivirus/main.go index 174e6fe3fb..8f0332ad1d 100644 --- a/services/antivirus/cmd/antivirus/main.go +++ b/services/antivirus/cmd/antivirus/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/app-provider/cmd/app-provider/main.go b/services/app-provider/cmd/app-provider/main.go index 42b66fd9c0..1d7474d45b 100644 --- a/services/app-provider/cmd/app-provider/main.go +++ b/services/app-provider/cmd/app-provider/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/app-registry/cmd/app-registry/main.go b/services/app-registry/cmd/app-registry/main.go index e00af3f2ab..ddb4faa295 100644 --- a/services/app-registry/cmd/app-registry/main.go +++ b/services/app-registry/cmd/app-registry/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/audit/cmd/audit/main.go b/services/audit/cmd/audit/main.go index 8b33880d6c..56413c60b5 100644 --- a/services/audit/cmd/audit/main.go +++ b/services/audit/cmd/audit/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/auth-app/cmd/auth-app/main.go b/services/auth-app/cmd/auth-app/main.go index d6cdb39e0c..ada20d1afd 100644 --- a/services/auth-app/cmd/auth-app/main.go +++ b/services/auth-app/cmd/auth-app/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/auth-basic/cmd/auth-basic/main.go b/services/auth-basic/cmd/auth-basic/main.go index 784d715be5..6235d5da74 100644 --- a/services/auth-basic/cmd/auth-basic/main.go +++ b/services/auth-basic/cmd/auth-basic/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/auth-bearer/cmd/auth-bearer/main.go b/services/auth-bearer/cmd/auth-bearer/main.go index 4bc12ab09c..8cab6c04a1 100644 --- a/services/auth-bearer/cmd/auth-bearer/main.go +++ b/services/auth-bearer/cmd/auth-bearer/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/auth-machine/cmd/auth-machine/main.go b/services/auth-machine/cmd/auth-machine/main.go index aeb79d5ccf..f2b0bdc360 100644 --- a/services/auth-machine/cmd/auth-machine/main.go +++ b/services/auth-machine/cmd/auth-machine/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/auth-service/cmd/auth-service/main.go b/services/auth-service/cmd/auth-service/main.go index 81ce1579e9..70b2c3d7f9 100644 --- a/services/auth-service/cmd/auth-service/main.go +++ b/services/auth-service/cmd/auth-service/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/clientlog/cmd/clientlog/main.go b/services/clientlog/cmd/clientlog/main.go index cdd91f273a..9c6595c600 100644 --- a/services/clientlog/cmd/clientlog/main.go +++ b/services/clientlog/cmd/clientlog/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/eventhistory/cmd/eventhistory/main.go b/services/eventhistory/cmd/eventhistory/main.go index 4a1d3f8701..47eb6483c1 100644 --- a/services/eventhistory/cmd/eventhistory/main.go +++ b/services/eventhistory/cmd/eventhistory/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/frontend/cmd/frontend/main.go b/services/frontend/cmd/frontend/main.go index 8e12e7761a..a3e887680f 100644 --- a/services/frontend/cmd/frontend/main.go +++ b/services/frontend/cmd/frontend/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/gateway/cmd/gateway/main.go b/services/gateway/cmd/gateway/main.go index 503e12de1c..766b15bcf9 100644 --- a/services/gateway/cmd/gateway/main.go +++ b/services/gateway/cmd/gateway/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/graph/cmd/graph/main.go b/services/graph/cmd/graph/main.go index 0775fcb487..b0d9189e0a 100644 --- a/services/graph/cmd/graph/main.go +++ b/services/graph/cmd/graph/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/groups/cmd/groups/main.go b/services/groups/cmd/groups/main.go index d13447d496..c1d4afadbe 100644 --- a/services/groups/cmd/groups/main.go +++ b/services/groups/cmd/groups/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/idm/cmd/idm/main.go b/services/idm/cmd/idm/main.go index ab6af89f2b..e61c15349d 100644 --- a/services/idm/cmd/idm/main.go +++ b/services/idm/cmd/idm/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/idp/cmd/idp/main.go b/services/idp/cmd/idp/main.go index d3def5ab1c..de20d3a5b3 100644 --- a/services/idp/cmd/idp/main.go +++ b/services/idp/cmd/idp/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/invitations/cmd/invitations/main.go b/services/invitations/cmd/invitations/main.go index 86da31fcb1..8c9a45aeab 100644 --- a/services/invitations/cmd/invitations/main.go +++ b/services/invitations/cmd/invitations/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/nats/cmd/nats/main.go b/services/nats/cmd/nats/main.go index 2e75edad3d..347a2cc3e9 100644 --- a/services/nats/cmd/nats/main.go +++ b/services/nats/cmd/nats/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/notifications/cmd/notifications/main.go b/services/notifications/cmd/notifications/main.go index 1836a24f85..73f31b88fc 100644 --- a/services/notifications/cmd/notifications/main.go +++ b/services/notifications/cmd/notifications/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/ocdav/cmd/ocdav/main.go b/services/ocdav/cmd/ocdav/main.go index 964af1667c..5a6d24390f 100644 --- a/services/ocdav/cmd/ocdav/main.go +++ b/services/ocdav/cmd/ocdav/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/ocm/cmd/ocm/main.go b/services/ocm/cmd/ocm/main.go index 6a4b7926d8..77a2913ba6 100644 --- a/services/ocm/cmd/ocm/main.go +++ b/services/ocm/cmd/ocm/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/ocs/cmd/ocs/main.go b/services/ocs/cmd/ocs/main.go index 8ae7d02622..96de1a08e1 100644 --- a/services/ocs/cmd/ocs/main.go +++ b/services/ocs/cmd/ocs/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/policies/cmd/policies/main.go b/services/policies/cmd/policies/main.go index 09abb5e85e..e774e8c4a6 100644 --- a/services/policies/cmd/policies/main.go +++ b/services/policies/cmd/policies/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/postprocessing/cmd/postprocessing/main.go b/services/postprocessing/cmd/postprocessing/main.go index e42d50ccdf..869d23db02 100644 --- a/services/postprocessing/cmd/postprocessing/main.go +++ b/services/postprocessing/cmd/postprocessing/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/proxy/cmd/proxy/main.go b/services/proxy/cmd/proxy/main.go index 9c51a443e4..889bc6772e 100644 --- a/services/proxy/cmd/proxy/main.go +++ b/services/proxy/cmd/proxy/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/search/cmd/search/main.go b/services/search/cmd/search/main.go index 807b664273..1426e298d3 100644 --- a/services/search/cmd/search/main.go +++ b/services/search/cmd/search/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/settings/cmd/settings/main.go b/services/settings/cmd/settings/main.go index 8833af4bbe..965c638540 100644 --- a/services/settings/cmd/settings/main.go +++ b/services/settings/cmd/settings/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/sharing/cmd/sharing/main.go b/services/sharing/cmd/sharing/main.go index cb5b4e5cca..c059753eb0 100644 --- a/services/sharing/cmd/sharing/main.go +++ b/services/sharing/cmd/sharing/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/sse/cmd/sse/main.go b/services/sse/cmd/sse/main.go index 9b31eea528..4e951b9251 100644 --- a/services/sse/cmd/sse/main.go +++ b/services/sse/cmd/sse/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/storage-publiclink/cmd/storage-publiclink/main.go b/services/storage-publiclink/cmd/storage-publiclink/main.go index e1637605c6..2207a7829e 100644 --- a/services/storage-publiclink/cmd/storage-publiclink/main.go +++ b/services/storage-publiclink/cmd/storage-publiclink/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/storage-shares/cmd/storage-shares/main.go b/services/storage-shares/cmd/storage-shares/main.go index 472cf04c8f..5a292e0ec2 100644 --- a/services/storage-shares/cmd/storage-shares/main.go +++ b/services/storage-shares/cmd/storage-shares/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/storage-system/cmd/storage-system/main.go b/services/storage-system/cmd/storage-system/main.go index 761e1ab233..9f2bdaa45e 100644 --- a/services/storage-system/cmd/storage-system/main.go +++ b/services/storage-system/cmd/storage-system/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/storage-users/cmd/storage-users/main.go b/services/storage-users/cmd/storage-users/main.go index 142e5a4413..62bf86fd00 100644 --- a/services/storage-users/cmd/storage-users/main.go +++ b/services/storage-users/cmd/storage-users/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/store/cmd/store/main.go b/services/store/cmd/store/main.go index 3bbf8cff80..4384dfab8c 100644 --- a/services/store/cmd/store/main.go +++ b/services/store/cmd/store/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/thumbnails/cmd/thumbnails/main.go b/services/thumbnails/cmd/thumbnails/main.go index 9f3cce9566..f2e8ce6267 100644 --- a/services/thumbnails/cmd/thumbnails/main.go +++ b/services/thumbnails/cmd/thumbnails/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/userlog/cmd/userlog/main.go b/services/userlog/cmd/userlog/main.go index 2df9a2a98f..58d53b0636 100644 --- a/services/userlog/cmd/userlog/main.go +++ b/services/userlog/cmd/userlog/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/users/cmd/user/main.go b/services/users/cmd/user/main.go index 6d69289324..35d221577c 100644 --- a/services/users/cmd/user/main.go +++ b/services/users/cmd/user/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/web/cmd/web/main.go b/services/web/cmd/web/main.go index 2ee45f9eeb..2331767f35 100644 --- a/services/web/cmd/web/main.go +++ b/services/web/cmd/web/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/webdav/cmd/webdav/main.go b/services/webdav/cmd/webdav/main.go index 08d0bdbbe4..444ea77ff8 100644 --- a/services/webdav/cmd/webdav/main.go +++ b/services/webdav/cmd/webdav/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) } diff --git a/services/webfinger/cmd/webfinger/main.go b/services/webfinger/cmd/webfinger/main.go index b67f9ba63e..112094e8a4 100644 --- a/services/webfinger/cmd/webfinger/main.go +++ b/services/webfinger/cmd/webfinger/main.go @@ -12,7 +12,7 @@ import ( func main() { cfg := defaults.DefaultConfig() - cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP) if err := command.Execute(cfg); err != nil { os.Exit(1) }