16552: Use sdnotify to signal to systemd that service is up.
authorTom Clegg <tom@curii.com>
Sun, 3 Jul 2022 04:50:40 +0000 (00:50 -0400)
committerTom Clegg <tom@curii.com>
Sun, 3 Jul 2022 04:50:40 +0000 (00:50 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/boot/cmd.go

index e22ae7ad7ea7104c6471f07286009013a2247cfa..4b7284556eef20c17594ec5115238d47f308455b 100644 (file)
@@ -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()
 }