diff --git a/services/activitylog/cmd/activitylog/main.go b/services/activitylog/cmd/activitylog/main.go index d10204f4c8..a8555bd20d 100644 --- a/services/activitylog/cmd/activitylog/main.go +++ b/services/activitylog/cmd/activitylog/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/activitylog/pkg/command" "github.com/owncloud/ocis/v2/services/activitylog/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 b37a1ca3ed..174e6fe3fb 100644 --- a/services/antivirus/cmd/antivirus/main.go +++ b/services/antivirus/cmd/antivirus/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/antivirus/pkg/command" "github.com/owncloud/ocis/v2/services/antivirus/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 c4afd562c2..42b66fd9c0 100644 --- a/services/app-provider/cmd/app-provider/main.go +++ b/services/app-provider/cmd/app-provider/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/app-provider/pkg/command" "github.com/owncloud/ocis/v2/services/app-provider/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 6a9d91f7d6..e00af3f2ab 100644 --- a/services/app-registry/cmd/app-registry/main.go +++ b/services/app-registry/cmd/app-registry/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/app-registry/pkg/command" "github.com/owncloud/ocis/v2/services/app-registry/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 f365e874ec..8b33880d6c 100644 --- a/services/audit/cmd/audit/main.go +++ b/services/audit/cmd/audit/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/audit/pkg/command" "github.com/owncloud/ocis/v2/services/audit/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 185d6eb9fd..d6cdb39e0c 100644 --- a/services/auth-app/cmd/auth-app/main.go +++ b/services/auth-app/cmd/auth-app/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/auth-app/pkg/command" "github.com/owncloud/ocis/v2/services/auth-app/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 ec5af41edf..784d715be5 100644 --- a/services/auth-basic/cmd/auth-basic/main.go +++ b/services/auth-basic/cmd/auth-basic/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/command" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 8617701cfd..4bc12ab09c 100644 --- a/services/auth-bearer/cmd/auth-bearer/main.go +++ b/services/auth-bearer/cmd/auth-bearer/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/command" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 937b0b20cd..aeb79d5ccf 100644 --- a/services/auth-machine/cmd/auth-machine/main.go +++ b/services/auth-machine/cmd/auth-machine/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/command" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 bcc7a625ec..81ce1579e9 100644 --- a/services/auth-service/cmd/auth-service/main.go +++ b/services/auth-service/cmd/auth-service/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/auth-service/pkg/command" "github.com/owncloud/ocis/v2/services/auth-service/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 ce0d4a4aff..cdd91f273a 100644 --- a/services/clientlog/cmd/clientlog/main.go +++ b/services/clientlog/cmd/clientlog/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/clientlog/pkg/command" "github.com/owncloud/ocis/v2/services/clientlog/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 d2172949bc..4a1d3f8701 100644 --- a/services/eventhistory/cmd/eventhistory/main.go +++ b/services/eventhistory/cmd/eventhistory/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/eventhistory/pkg/command" "github.com/owncloud/ocis/v2/services/eventhistory/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 cbdc5dac51..8e12e7761a 100644 --- a/services/frontend/cmd/frontend/main.go +++ b/services/frontend/cmd/frontend/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/frontend/pkg/command" "github.com/owncloud/ocis/v2/services/frontend/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 7844daa6af..0775fcb487 100644 --- a/services/graph/cmd/graph/main.go +++ b/services/graph/cmd/graph/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/graph/pkg/command" "github.com/owncloud/ocis/v2/services/graph/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 2172fc8450..d13447d496 100644 --- a/services/groups/cmd/groups/main.go +++ b/services/groups/cmd/groups/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/groups/pkg/command" "github.com/owncloud/ocis/v2/services/groups/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 f30202e587..ab6af89f2b 100644 --- a/services/idm/cmd/idm/main.go +++ b/services/idm/cmd/idm/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/idm/pkg/command" "github.com/owncloud/ocis/v2/services/idm/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 174283c909..d3def5ab1c 100644 --- a/services/idp/cmd/idp/main.go +++ b/services/idp/cmd/idp/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/idp/pkg/command" "github.com/owncloud/ocis/v2/services/idp/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 3290c0b306..86da31fcb1 100644 --- a/services/invitations/cmd/invitations/main.go +++ b/services/invitations/cmd/invitations/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/invitations/pkg/command" "github.com/owncloud/ocis/v2/services/invitations/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 4b5803ac78..2e75edad3d 100644 --- a/services/nats/cmd/nats/main.go +++ b/services/nats/cmd/nats/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/nats/pkg/command" "github.com/owncloud/ocis/v2/services/nats/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 5d5752af38..1836a24f85 100644 --- a/services/notifications/cmd/notifications/main.go +++ b/services/notifications/cmd/notifications/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/notifications/pkg/command" "github.com/owncloud/ocis/v2/services/notifications/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 9875027bdb..964af1667c 100644 --- a/services/ocdav/cmd/ocdav/main.go +++ b/services/ocdav/cmd/ocdav/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/ocdav/pkg/command" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 6ac3d5a577..6a4b7926d8 100644 --- a/services/ocm/cmd/ocm/main.go +++ b/services/ocm/cmd/ocm/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/ocm/pkg/command" "github.com/owncloud/ocis/v2/services/ocm/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 a2b9021ead..8ae7d02622 100644 --- a/services/ocs/cmd/ocs/main.go +++ b/services/ocs/cmd/ocs/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/ocs/pkg/command" "github.com/owncloud/ocis/v2/services/ocs/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 db0896e407..09abb5e85e 100644 --- a/services/policies/cmd/policies/main.go +++ b/services/policies/cmd/policies/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/policies/pkg/command" "github.com/owncloud/ocis/v2/services/policies/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 ddc191e3a3..e42d50ccdf 100644 --- a/services/postprocessing/cmd/postprocessing/main.go +++ b/services/postprocessing/cmd/postprocessing/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/postprocessing/pkg/command" "github.com/owncloud/ocis/v2/services/postprocessing/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 7db75b5de0..9c51a443e4 100644 --- a/services/proxy/cmd/proxy/main.go +++ b/services/proxy/cmd/proxy/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/proxy/pkg/command" "github.com/owncloud/ocis/v2/services/proxy/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 70103e7bf0..807b664273 100644 --- a/services/search/cmd/search/main.go +++ b/services/search/cmd/search/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/search/pkg/command" "github.com/owncloud/ocis/v2/services/search/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 1e21338dd8..8833af4bbe 100644 --- a/services/settings/cmd/settings/main.go +++ b/services/settings/cmd/settings/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/settings/pkg/command" "github.com/owncloud/ocis/v2/services/settings/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 54e0996e3f..cb5b4e5cca 100644 --- a/services/sharing/cmd/sharing/main.go +++ b/services/sharing/cmd/sharing/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/sharing/pkg/command" "github.com/owncloud/ocis/v2/services/sharing/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 8bd438f114..9b31eea528 100644 --- a/services/sse/cmd/sse/main.go +++ b/services/sse/cmd/sse/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/sse/pkg/command" "github.com/owncloud/ocis/v2/services/sse/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 6d2415a007..e1637605c6 100644 --- a/services/storage-publiclink/cmd/storage-publiclink/main.go +++ b/services/storage-publiclink/cmd/storage-publiclink/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/command" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 8a8f9336be..472cf04c8f 100644 --- a/services/storage-shares/cmd/storage-shares/main.go +++ b/services/storage-shares/cmd/storage-shares/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/command" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 d9242ea057..761e1ab233 100644 --- a/services/storage-system/cmd/storage-system/main.go +++ b/services/storage-system/cmd/storage-system/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/storage-system/pkg/command" "github.com/owncloud/ocis/v2/services/storage-system/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 c3c7bc7e3f..142e5a4413 100644 --- a/services/storage-users/cmd/storage-users/main.go +++ b/services/storage-users/cmd/storage-users/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/storage-users/pkg/command" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 ecf42e8193..3bbf8cff80 100644 --- a/services/store/cmd/store/main.go +++ b/services/store/cmd/store/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/store/pkg/command" "github.com/owncloud/ocis/v2/services/store/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 f0a86f58bf..9f3cce9566 100644 --- a/services/thumbnails/cmd/thumbnails/main.go +++ b/services/thumbnails/cmd/thumbnails/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/command" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 efdb7ae4b8..2df9a2a98f 100644 --- a/services/userlog/cmd/userlog/main.go +++ b/services/userlog/cmd/userlog/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/userlog/pkg/command" "github.com/owncloud/ocis/v2/services/userlog/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 cae358d3c0..6d69289324 100644 --- a/services/users/cmd/user/main.go +++ b/services/users/cmd/user/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/users/pkg/command" "github.com/owncloud/ocis/v2/services/users/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 9974c37fc9..2ee45f9eeb 100644 --- a/services/web/cmd/web/main.go +++ b/services/web/cmd/web/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/web/pkg/command" "github.com/owncloud/ocis/v2/services/web/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 84449ec2e3..08d0bdbbe4 100644 --- a/services/webdav/cmd/webdav/main.go +++ b/services/webdav/cmd/webdav/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/webdav/pkg/command" "github.com/owncloud/ocis/v2/services/webdav/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + 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 f370d1c9e9..b67f9ba63e 100644 --- a/services/webfinger/cmd/webfinger/main.go +++ b/services/webfinger/cmd/webfinger/main.go @@ -1,14 +1,19 @@ package main import ( + "context" "os" + "os/signal" + "syscall" "github.com/owncloud/ocis/v2/services/webfinger/pkg/command" "github.com/owncloud/ocis/v2/services/webfinger/pkg/config/defaults" ) func main() { - if err := command.Execute(defaults.DefaultConfig()); err != nil { + cfg := defaults.DefaultConfig() + cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) + if err := command.Execute(cfg); err != nil { os.Exit(1) } }