-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add support for s6-style readiness notification #299
Comments
Just a thought I had, for "ready" conditions we could use the existing automatic conditions right? e.g. To make it backwards compatible it would probably need to set both: |
After a good cup of coffee I'm leaning towards changing the SVC state machine's state names. I think you @hongkongkiwi are the only one using the automatic conditions currently, so you might be affected by the change. Therefore I'm curious to hear what you think about this:
That way the Update: I'm doubting the naming of more states, e.g. Update 2: Alternatively rename |
Final draft. This one should work without too many ambiguities. What do you think @wkz? |
This patch renames the internal states for run/task/services to avoid any confusion with the introduction of 'ready:scripts'. * WAITING -> PAUSED * READY -> WAITING A service condition that used, e.g., <service/foo/ready> should now instead use <service/foo/waiting>. Note: A new condition with the old name <service/foo/ready> will be introduced shortly to signify service "readiness", a concept used in other PID 1, like systemd and s6. For details, see issue #299. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Change in state names, and thus automatic conditions, now rolled out to the master branch. |
systemd provides the
sd_notify()
family of APIs, which supports many different commands that can be sent from a daemon to systemd, e.g.READY=1\n
s6 supports a
/run/service/foo/notification-fd
which the daemon is expected to send a\n
and then close when it's ready. E.g., mdevd supports the-D fd
option.This issue suggests adding a
notify[:condition]
option for service stanzas be added. When thisnotify
option is set the third (3rd) descriptor passed to a daemon is this notification channel. The command line to a daemon can then comprise a"%n"
format specifier, e.g.mdevd -D %n ...
which Finit replaces with the file descriptor number.The
notifiy
option would also change the semantics of thepid:/run/foo.pid
option slightly. Whennotifiy
is set, the PID file/run/foo.pid
is not created until the daemon has sent a notification. (For reference, when thenotify
option is not set the PID file is created as soon as the process has been forked off, as it does currently.)The text was updated successfully, but these errors were encountered: