From b62791617cd7cd767c3a8958a7ff7ef457b1149d Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 12 May 2023 16:42:17 -0700 Subject: [PATCH] fix: notify systemd as soon as we wait on the OS signal (#17199) --- cmd/server-main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/server-main.go b/cmd/server-main.go index e212e13e2..c53c12a81 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -664,10 +664,7 @@ func serverMain(ctx *cli.Context) { setConsoleSrv(srv) go func() { - server := newConsoleServerFn() - logger.FatalIf(server.Listen(), "Unable to initialize console server's sockets") - daemon.SdNotify(false, daemon.SdNotifyReady) - logger.FatalIf(server.Serve(), "Unable to initialize console server") + logger.FatalIf(newConsoleServerFn().Serve(), "Unable to initialize console server") }() } @@ -790,6 +787,8 @@ func serverMain(ctx *cli.Context) { logger.Info("======") } + daemon.SdNotify(false, daemon.SdNotifyReady) + <-globalOSSignalCh }