1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Systemd readiness notification

This change implements the systemd readiness notification, using
the sd_notify protocol.

See https://www.freedesktop.org/software/systemd/man/sd_notify.html.
This commit is contained in:
Ilya Mateyko 2021-03-10 23:10:17 +00:00 committed by fguillot
parent 1d80c12e18
commit 89c1b3b4d8
4 changed files with 51 additions and 5 deletions

View file

@ -44,6 +44,11 @@ func startDaemon(store *storage.Storage) {
go collector.GatherStorageMetrics()
}
// Notify systemd that we are ready.
if err := sdNotify(sdNotifyReady); err != nil {
logger.Error("Unable to send readiness notification to systemd: %v", err)
}
<-stop
logger.Info("Shutting down the process...")
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)