-
Notifications
You must be signed in to change notification settings - Fork 5.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
Support systemd notify protocol #17062
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
harshavardhana
requested changes
Apr 21, 2023
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.
This needs more than what is being done in the PR @WGH- are you intending to add more things here?
On April 21, 2023 9:29:21 PM GMT+03:00, Harshavardhana ***@***.***> wrote:
This needs more than what is being done in the PR @WGH- are you intending to add more things here?
I think no, at least not here. minio.service is in another repo, I think.
|
harshavardhana
requested changes
Apr 30, 2023
This will allow to set Type=notify in systemd service. Thanks to this, 'systemctl start' will actually wait for the ready notification instead of exiting when process has just started. This will also allow to use After=minio.service for proper startup ordering. If some other service depends on MinIO, it will wait until MinIO is actually up and listening on its port. Unfortunately, `Server.Serve` has some additional setup going on instead of just launching serving goroutines, so in some cases systemd may report success with MinIO failing shortly after. Thankfully, listening sockets are still bound before, so proper startup ordering will still be achieved. "Stopping" and "reloading" notifications are mostly decorative, and will be reported in 'systemctl status'. If not running under systemd, or running without Type=notify, these changes have no effect.
harshavardhana
approved these changes
May 1, 2023
WGH-
added a commit
to WGH-/minio-service
that referenced
this pull request
May 2, 2023
This tells systemd that minio supports startup notification protocol, and will wait until it tells it's ready before launching dependent (After=) services. See minio/minio#17062
WGH-
added a commit
to WGH-/minio-service
that referenced
this pull request
May 3, 2023
This tells systemd that minio supports startup notification protocol, and will wait until it tells it's ready before launching dependent (After=) services. See minio/minio#17062
harshavardhana
pushed a commit
to minio/minio-service
that referenced
this pull request
May 3, 2023
This tells systemd that minio supports startup notification protocol, and will wait until it tells it's ready before launching dependent (After=) services. See minio/minio#17062
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add support for systemd notification protocol (https://www.freedesktop.org/software/systemd/man/sd_notify.html)
Motivation and Context
This will allow to set
Type=notify
in systemd service.Thanks to this,
systemctl start
will actually wait for the ready notification instead of exiting when process has just started.This will also allow to use
After=minio.service
for proper startup ordering. If some other service depends on MinIO, it will wait until MinIO is actually up and listening on its port.Unfortunately,
Server.Serve
function has some additional setup going on instead of just launching serving goroutines, so in some cases systemd may report success with MinIO failing shortly after. Thankfully, listening sockets are still bound before, so proper startup ordering will still be achieved."Stopping" notification is mostly decorative, and will be reported in
systemctl status
.If not running under systemd, or running without
Type=notify
, these changes have no effect.How to test this PR?
Types of changes
Checklist:
commit-id
orPR #
here)