goauthentik / goauthentik/authentik
Support systemd notify
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 644
Description
**Is your feature request related to a problem? Please describe.**
I'm running authentik in a podman container started by systemd.
I have another service which depends on authentik running and being ready.
My problem is that authentik always takes some time to start up,
but systemd has currently no way of knowing when authentik is ready and starts the other service directly after starting authentik,
which leads to the other service crashing once and restarting (this should be handled better in the other service, but I have no control over that).
**Describe the solution you'd like**
Systemd has a really simple protocol to notify when an application is ready. Podman proxies the socket used for the protocol into a container by default: https://docs.podman.io/en/latest/markdown/podman-run.1.html#sdnotify-container-conmon-healthy-ignore
The protocol is described here: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#Notes
It's basically just connecting to the socket specified in the `NOTIFY_SOCKET` environment variable and sending `READY=1` via a single datagram.
I found this python implementation which could be used, or it could just be implemented as a single function, as it's very simple.
https://github.com/bb4242/sdnotify/
**Describe alternatives you've considered**
- Hacking together an ugly solution with shell scripts
- Leaving it as is
**Additional context**
I would be willing to try to implement this feature by myself.
Contributor guide
Assessment
This issue has not been assessed yet.