-
Notifications
You must be signed in to change notification settings - Fork 242
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 fork-free readiness notification protocol #308
Comments
I attempted to post this message to supervision@list.skarnet.org, but I had trouble subscribing to the mailing list so that I could post to it:
|
Hi, that page was since updated to reflect that, for S6, you do need to close the readiness FD. |
The choice to allow data before the newline was made to be able to support existing daemons which print a single line on readiness. Think of e.g.
For the design the daemon and service manager need to agree on an fd. What you are losing by forcing the daemon to adapt to a dynamic choice from the service manager is the ability to easily co-opt low fds. Think of a daemon that prints a line to stdout on readiness and never uses stdout again. For s6 you could write |
You do not need to close the fd. But since the reader (the supervisor) stops reading (and closes its end of the pipe) after a newline, it makes no sense for the daemon to keep it open, so it is good practice to close it. The notification happens when a newline character is written: the supervisor considers the service is ready as soon as it reads a The s6 mechanism makes the notification file descriptor configurable (in the I am surprised that you had trouble subscribing to the supervision mailing-list, which has always worked, and even more surprised that I didn't hear of your attempt, or of your question, for more than two years. |
A service manager can allow configuring a static The daemon will then start with Note that, while this is possible, I'm not entirely sure it's a good idea. I think daemons should opt into this mechanism, rather than one assume that they behave in a compatible way. There may be an uncommon scenario where a service prints to stdout before being ready, breaking expectations. |
When using start-stop-daemon with the daemonize option or the supervisor method, it would be nice to be able to still get notifications of the service being ready. I pieced together a spec based on conversations with Ian Jackson and the s6 mechanism. It can be found in this repo. That is the reference implementation, and the protocol can be emulated using s6. Furthermore I added support for the protocol to my active fork of upstart.
Would be nice if openrc supported it so that alternative service managers had a unified mechanism for service readiness. If you would like more notes on the reference implementation (similar to how s-s-d would work) or the other implementation (which uses an event loop to wait for notifications from several services).
Potential users of the spec specifically expressed interest in your views on the protocol, so I would sincerely appreciate if you weighed in. (swaywm/swaylock#42)
The text was updated successfully, but these errors were encountered: