From 7999e2969bd011afb2c6c37cd30be2d9c9554e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 24 Jul 2024 14:02:52 +0200 Subject: [PATCH] do not force exit to let all services shutdown gracefully MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- services/activitylog/pkg/command/server.go | 2 -- services/app-provider/pkg/command/server.go | 1 - services/app-registry/pkg/command/server.go | 1 - services/audit/pkg/command/server.go | 2 -- services/auth-app/pkg/command/server.go | 1 - services/auth-basic/pkg/command/server.go | 1 - services/auth-bearer/pkg/command/server.go | 1 - services/auth-machine/pkg/command/server.go | 1 - services/auth-service/pkg/command/server.go | 1 - services/clientlog/pkg/command/server.go | 2 -- services/frontend/pkg/command/server.go | 1 - services/graph/pkg/command/server.go | 2 -- services/groups/pkg/command/server.go | 1 - services/idm/pkg/command/server.go | 1 - services/idp/pkg/command/server.go | 1 - services/invitations/pkg/command/server.go | 2 -- services/nats/pkg/command/server.go | 2 -- services/ocdav/pkg/command/server.go | 2 -- services/ocm/pkg/command/server.go | 1 - services/ocs/pkg/command/server.go | 2 -- services/postprocessing/pkg/command/server.go | 1 - services/proxy/pkg/command/server.go | 2 -- services/settings/pkg/command/server.go | 3 --- services/sharing/pkg/command/server.go | 1 - services/storage-publiclink/pkg/command/server.go | 1 - services/storage-shares/pkg/command/server.go | 1 - services/storage-system/pkg/command/server.go | 1 - services/storage-users/pkg/command/server.go | 1 - services/store/pkg/command/server.go | 2 -- services/thumbnails/pkg/command/server.go | 2 -- services/userlog/pkg/command/server.go | 2 -- services/users/pkg/command/server.go | 1 - services/web/pkg/command/server.go | 1 - services/webdav/pkg/command/server.go | 2 -- services/webfinger/pkg/command/server.go | 2 -- 35 files changed, 51 deletions(-) diff --git a/services/activitylog/pkg/command/server.go b/services/activitylog/pkg/command/server.go index 4f9d7d1d4..232bc1aa1 100644 --- a/services/activitylog/pkg/command/server.go +++ b/services/activitylog/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/stream" @@ -140,7 +139,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index ff001ad9a..450bb2d7a 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index 61a27a3c0..b8d1a790b 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -60,7 +60,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index aeaf01128..93f945e49 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/stream" @@ -55,7 +54,6 @@ func Server(cfg *config.Config) *cli.Command { Err(err). Msg("Shutting down server") cancel() - os.Exit(1) }) { diff --git a/services/auth-app/pkg/command/server.go b/services/auth-app/pkg/command/server.go index 3ba0674a8..323e203c7 100644 --- a/services/auth-app/pkg/command/server.go +++ b/services/auth-app/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index dd0f247e5..a89ccb532 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -74,7 +74,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index d2e886348..1c8e239b3 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 070b00a6d..0a4dcbb59 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/auth-service/pkg/command/server.go b/services/auth-service/pkg/command/server.go index 05e0ca124..58ab0dde1 100644 --- a/services/auth-service/pkg/command/server.go +++ b/services/auth-service/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/clientlog/pkg/command/server.go b/services/clientlog/pkg/command/server.go index b87ec8f23..80261be3d 100644 --- a/services/clientlog/pkg/command/server.go +++ b/services/clientlog/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/stream" @@ -113,7 +112,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index 83c011be6..cd22a4be7 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -65,7 +65,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 0cde2d4db..7c10c330b 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" @@ -64,7 +63,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index 3bdf02270..cd6dffcb6 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -74,7 +74,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index 16e8a081f..3ec90806a 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -90,7 +90,6 @@ func Server(cfg *config.Config) *cli.Command { Err(err). Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index 78f658f14..02bf30eaa 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -90,7 +90,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/invitations/pkg/command/server.go b/services/invitations/pkg/command/server.go index 183627c2d..0b2b358cd 100644 --- a/services/invitations/pkg/command/server.go +++ b/services/invitations/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" @@ -84,7 +83,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index f7b00f293..983909d8c 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -4,7 +4,6 @@ import ( "context" "crypto/tls" "fmt" - "os" "github.com/oklog/run" @@ -109,7 +108,6 @@ func Server(cfg *config.Config) *cli.Command { natsServer.Shutdown() cancel() - os.Exit(1) }) return gr.Run() diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index e7573be41..4272419e8 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/micro/ocdav" "github.com/cs3org/reva/v2/pkg/sharedconf" @@ -104,7 +103,6 @@ func Server(cfg *config.Config) *cli.Command { Str("server", c.Command.Name). Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/ocm/pkg/command/server.go b/services/ocm/pkg/command/server.go index 6dd6f8f2f..6dc234fda 100644 --- a/services/ocm/pkg/command/server.go +++ b/services/ocm/pkg/command/server.go @@ -62,7 +62,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index 4a70945a8..1054ea2e2 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" @@ -77,7 +76,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/postprocessing/pkg/command/server.go b/services/postprocessing/pkg/command/server.go index 5ccf65e6c..6715a9146 100644 --- a/services/postprocessing/pkg/command/server.go +++ b/services/postprocessing/pkg/command/server.go @@ -82,7 +82,6 @@ func Server(cfg *config.Config) *cli.Command { Str("server", "http"). Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 2d02094a9..7888a6979 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -5,7 +5,6 @@ import ( "crypto/tls" "fmt" "net/http" - "os" "time" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" @@ -216,7 +215,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 73cbe437f..5b11f00a5 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" @@ -74,7 +73,6 @@ func Server(cfg *config.Config) *cli.Command { Str("server", "http"). Msg("shutting down server") cancel() - os.Exit(1) }) // prepare a gRPC server and add it to the group run. @@ -93,7 +91,6 @@ func Server(cfg *config.Config) *cli.Command { Str("server", "grpc"). Msg("shutting down server") cancel() - os.Exit(1) }) // prepare a debug server and add it to the group run. diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index d7e4ba47d..5fc2bf58c 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -77,7 +77,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index 3c3bacc70..64551f036 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 1e2a8745f..4cc258a84 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index f09e2f1f6..369f2a5ad 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -61,7 +61,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index 444ce0a6d..c4b413791 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -63,7 +63,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index 9d32b3194..8971d7551 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" @@ -68,7 +67,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index ea9288a55..f95cf9978 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" @@ -69,7 +68,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) server, err := debug.Server( diff --git a/services/userlog/pkg/command/server.go b/services/userlog/pkg/command/server.go index 2535c3817..71a52ca7f 100644 --- a/services/userlog/pkg/command/server.go +++ b/services/userlog/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/stream" @@ -141,7 +140,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index 2b96aac54..92094a627 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -74,7 +74,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) debugServer, err := debug.Server( diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 2c3adfb21..5ba913431 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -89,7 +89,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index 34e2b0737..d7ed38624 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" @@ -79,7 +78,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) } diff --git a/services/webfinger/pkg/command/server.go b/services/webfinger/pkg/command/server.go index b0e3453d7..0ba9cbe12 100644 --- a/services/webfinger/pkg/command/server.go +++ b/services/webfinger/pkg/command/server.go @@ -3,7 +3,6 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" @@ -92,7 +91,6 @@ func Server(cfg *config.Config) *cli.Command { Msg("Shutting down server") cancel() - os.Exit(1) }) }