-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use sdnotify for systemd #768
Conversation
This is useful if a configuration is long to load. Systemd will continue dependency chain only when server have finish to start. https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
design LGTM 😻
After a night of reflection... I think we can do a better design :) |
Main problem is server.Start() is a blocking function. I can't evaluate when it finish to listen on socket etc. |
Changes can be squashed and pushed with 1-clic |
Many thanks to @nikkau ! |
defer server.Close() | ||
sent, err := daemon.SdNotify("READY=1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to call server.Start()
before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a good idea :) .
Sorry, bad C/C.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully tests was there to protect us, but @emilevauge eyes are quite faster ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM \o/
Let's squash the commit too if possible 👼 |
@vdemeester this can be done via GH button ;) |
@guilhem that's true, but I am not a huge fan of that 😸 — but let's do it 😝 |
@vdemeester this have 1 advantage: keeping history in PR. |
@guilhem hum yeah but sometimes you want to actually have a PR with multiples commit merged as is. Anyway, this is no big deal 😝 |
* Use sdnotify for systemd This is useful if a configuration is long to load. Systemd will continue dependency chain only when server have finish to start. https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= * Extract the waiting behavior from Start()
This is useful if a configuration is long to load.
Systemd will continue dependency chain only when server have finish to start.
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=