mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Use systemd notification where applicable
With this change in place, the grafana service will signal readiness to serve by writing "READY=1" to the path specified through the NOTIFY_SOCKET environment variable. If this environment variable is not present or empty, no notification will happen. This notification is the standard systemd mechanism for indicating a service is ready to serve. For Grafana this may be a couple of seconds from startup due to database migrations. This change also adjusts the Grafana systemd service definition to make use of this feature.
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/social"
|
||||
"github.com/grafana/grafana/pkg/tracing"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
func NewGrafanaServer() models.GrafanaServer {
|
||||
@@ -96,6 +97,7 @@ func (g *GrafanaServerImpl) Start() {
|
||||
return
|
||||
}
|
||||
|
||||
util.SdNotify("READY=1")
|
||||
g.startHttpServer()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user