On 20/05/2016 16:11, Max Ivanov wrote:
That is what I ended up doing, but without an `-wu` part, thanks for the tip.
Yes, the -wu is necessary to avoid a race condition where s6-svwait could run before the service is actually up, and would exit right away (the same issue you encountered initially).
What concerned me at first is that s6-svwait page explicitly states that "s6-svwait only waits for notifications; it never polls.", which might mean that if service went down before s6-svwait started, then it can't wait forever for "down" notification. I then checked with two consecutive `s6-svwait -D` calls and both detected that service already down and exited, so s6-svwait is actually level-triggered, not edge triggered.
Yes, s6-svwait never polls... after the first time. It still has to check the initial state of the service once at start, like all the tools in the family. So if the initial state is down, s6-svwait -D will immediately succeed. -- Laurent
