S6-SVWAIT(8)

NAME
s6-svwait - block until a collection of supervised services goes up, or down

SYNOPSIS
s6-svwait [-U | -u | -D | -d | -r | -R] [-a | -o] [-t timeout] servicedir...

DESCRIPTION
s6-svwait monitors one or more s6-service-directory(7)s given as its arguments, waiting for a state (ready, up or down) to happen. If no service directories are listed, it immediately exits 0.

s6-svwait only waits for notifications; it never polls.

s6-svwait should be given one or more service directories as arguments, not an s6-scan-directory(7). 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(8) process running on them. It will not work on a service directory where s6-supervise(8) has not been started yet.

OPTIONS

-u  Up. s6-svwait will wait until the services are up, as reported by s6-supervise(8). This is the default; it is not reliable, but it does not depend on specific support in the service programs. See s6-notifywhenup(7) for details.

-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 s6-service-directory(7). See the explanation in s6-notifywhenup(7).

-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 servicedir / finish for every servicedir have finished executing (or have timed out and been killed).

-r  Restart. s6-svwait will wait until the services are down, then until they are up. If the -o option is given, it waits until all services are down and one service is up; otherwise it waits until all the services have restarted.

-R  Restart and ready. s6-svwait will wait until the services are down, then until they are up and ready. If the -o option is given, it waits until all services are down and one service is up and ready; otherwise it waits until all the services have restarted and are ready.

-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 limit.

IMPLEMENTATION NOTES
s6-svwait spawns an s6-ftrigrd(8) child to listen to notifications sent by s6-supervise(8). It also checks supervise/status files to get the current service states, so it is immune to race conditions.

EXIT STATUS

0   Success, the wanted state has been reached.

99  Timed out.

100 Wrong usage.

102 The s6-supervise(8) process monitoring the service died.

111 System call failed.

n   Services were expected to come up, but n of them reported permanent failure.

SEE ALSO
s6-notifyoncheck(8), s6-permafailon(8), s6-supervise(8), s6-svc(8), s6-svdt(8), s6-svdt-clear(8), s6-svlisten(8), s6-svlisten1(8), s6-svok(8), s6-svscan(8), s6-svscanctl(8), s6-svstat(8)

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-svwait.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)