cockroach: github.com/cockroachdb/cockroach/pkg/util/sdnotify Index | Files

package sdnotify

import "github.com/cockroachdb/cockroach/pkg/util/sdnotify"

Package sdnotify implements both sides of the systemd readiness protocol. Servers can use sdnotify.Ready() to signal that they are ready to receive traffic, and process managers can use sdnotify.Exec() to run processes that implement this protocol.

Index

Package Files

sdnotify.go sdnotify_unix.go

func Exec Uses

func Exec(cmd *exec.Cmd) error

Exec the given command in the background using the systemd notification protocol. This function returns once the command has either exited or signaled that it is ready. If the command exits with a non-zero status before signaling readiness, returns an exec.ExitError.

func Ready Uses

func Ready() error

Ready sends a readiness signal using the systemd notification protocol. It should be called (once) by a server after it has completed its initialization (including but not necessarily limited to binding ports) and is ready to receive traffic.

Package sdnotify imports 7 packages (graph) and is imported by 6 packages. Updated 2019-07-09. Refresh now. Tools for package owners.