The s6-svwait program
s6-svwait blocks until a collection of supervised services goes up, or down.
s6-svwait only waits for notifications; it never polls.
s6-svwait [ -U | -u | -D | -d ] [ -a | -o ] [ -t timeout ] servicedir...
s6-svwait monitors one or more service
directories given as its arguments, waiting for a state (ready, up or down) to
- 0: success, the wanted state has been reached
- 99: timed out
- 100: wrong usage
- 102: the s6-supervise process monitoring the service died
- 111: system call failed
- n: services were expected to come up, but n of them
reported permanent failure
- -u : up. s6-svwait will wait until the services are up, as
reported by s6-supervise.
This is the default; it is not reliable, but it does not depend on specific
support in the service programs. See this page
- -U : really up. s6-svwait will wait until the services are
up and ready as reported by the services themselves. This requires
specific support in the service programs, and the use of the
notification-fd file in the
See the explanation on this page.
- -d : down. s6-svwait will wait until the services are down.
- -D : really down. s6-svwait will wait until the
services are down and the cleanup scripts in
for every servicedir
have finished executing (or have timed out and been killed).
- -o : or. s6-svwait will wait until one of the
given services comes up or down.
- -a : and. s6-svwait will wait until all of the
given services come up or down. This is the default.
- -t timeout : if the requested events have not
happened after timeout milliseconds, s6-svwait will print a message
to stderr and exit 99. By default, timeout is 0, which means no time
- s6-svwait should be given one or more service directories as
arguments, not a scan directory. If you need to wait for a whole
scan directory, give all its contents as arguments to s6-svwait.
- s6-svwait will only work on service directories that are already
active, i.e. have an s6-supervise process
running on them. It will not work on a service directory where
s6-supervise has not been started yet.
s6-svwait spawns a s6-ftrigrd child to
listen to notifications sent by s6-supervise.
It also checks supervise/status files to get the current service
states, so it is immune to race conditions.