Skip to content

support systemd notifications #1733

@slingamn

Description

@slingamn

https://www.freedesktop.org/software/systemd/man/systemd.service.html

Behavior of notify is similar to exec; however, it is expected that the service sends a notification message via sd_notify(3) or an equivalent call when it has finished starting up. systemd will proceed with starting follow-up units after this notification message has been sent. If this option is used, NotifyAccess= (see below) should be set to open access to the notification socket provided by systemd. If NotifyAccess= is missing or set to none, it will be forcibly set to main.

The main thing here is to send READY=1 after opening the listeners; this allows other service startups to block until Ergo is ready. (We could also send RELOADING=1 at the start of rehash, and STOPPING=1 at the start of shutdown.) Here's a (trivial) Golang library for this:

https://github.com/okzk/sdnotify

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions