From a4691611a7338ba3118281ed544b2de15ade628f Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 16 Aug 2016 23:24:51 -0700 Subject: [PATCH] Move initGracefulShutdown before objectLayer initialization (#2468) --- cmd/routers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/routers.go b/cmd/routers.go index 17da5bb77..eb1053f9d 100644 --- a/cmd/routers.go +++ b/cmd/routers.go @@ -65,10 +65,6 @@ func newObjectLayerFactory(disks, ignoredDisks []string) func() ObjectLayer { err = cleanupOldBucketPolicyConfigs() fatalIf(err, "Unable to clean up bucket policy from config directory.") - // Initialize and monitor shutdown signals. - err = initGracefulShutdown(os.Exit) - fatalIf(err, "Unable to initialize graceful shutdown operation") - // Register the callback that should be called when the process shuts down. globalShutdownCBs.AddObjectLayerCB(func() errCode { if sErr := objAPI.Shutdown(); sErr != nil { @@ -95,6 +91,10 @@ func configureServerHandler(srvCmdConfig serverCmdConfig) http.Handler { storageRPCs, err := newRPCServer(srvCmdConfig) fatalIf(err, "Unable to initialize storage RPC server.") + // Initialize and monitor shutdown signals. + err = initGracefulShutdown(os.Exit) + fatalIf(err, "Unable to initialize graceful shutdown operation") + newObjectLayerFn := newObjectLayerFactory(srvCmdConfig.disks, srvCmdConfig.ignoredDisks) // Initialize API. apiHandlers := objectAPIHandlers{