From 1e8ea2315684b951e6d4bde99b98a5b4108f5e4e Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Sun, 3 Jul 2022 00:50:40 -0400 Subject: [PATCH] 16552: Use sdnotify to signal to systemd that service is up. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/boot/cmd.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/boot/cmd.go b/lib/boot/cmd.go index e22ae7ad7e..4b7284556e 100644 --- a/lib/boot/cmd.go +++ b/lib/boot/cmd.go @@ -15,6 +15,7 @@ import ( "git.arvados.org/arvados.git/lib/cmd" "git.arvados.org/arvados.git/sdk/go/ctxlog" + "github.com/coreos/go-systemd/daemon" ) var Command cmd.Handler = bootCommand{} @@ -134,6 +135,9 @@ func (bcmd bootCommand) run(ctx context.Context, prog string, args []string, std return nil } } + if _, err := daemon.SdNotify(false, "READY=1"); err != nil { + super.logger.WithError(err).Errorf("error notifying init daemon") + } // Wait for signal/crash + orderly shutdown return super.Wait() } -- 2.30.2