From bff7930fee522c762f35bb9acb7430b173b4a1c1 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Tue, 3 Aug 2021 19:53:21 +0200 Subject: [PATCH] Fix initial start of etcd only nodes (#3748) Signed-off-by: Brad Davidson Signed-off-by: galal-hussein (cherry picked from commit 2069cdf4eee6af8ba9c7523e62abaa511bac709e) --- pkg/cli/server/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cli/server/server.go b/pkg/cli/server/server.go index d38480950ae7..3f192c45a6a9 100644 --- a/pkg/cli/server/server.go +++ b/pkg/cli/server/server.go @@ -418,6 +418,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont logrus.Info("Starting " + version.Program + " " + app.App.Version) + notifySocket := os.Getenv("NOTIFY_SOCKET") + ctx := signals.SetupSignalHandler(context.Background()) if err := server.StartServer(ctx, &serverConfig, cfg); err != nil { @@ -434,7 +436,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont } logrus.Info(version.Program + " is up and running") - if (cfg.DisableAgent || cfg.DisableAPIServer) && os.Getenv("NOTIFY_SOCKET") != "" { + if (cfg.DisableAgent || cfg.DisableAPIServer) && notifySocket != "" { + os.Setenv("NOTIFY_SOCKET", notifySocket) systemd.SdNotify(true, "READY=1\n") } }()