S6-SVWAIT(8)
Hey bestie! Welcome to s6-svwait(8) β a page from the System Manager's Manual. This is the little tool that watches one or more service directories and waits for a state to happen. Let's get into it π
πΈ NAME πΈ
Okay so s6-svwait β it 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. Periodt.
β¨ SYNOPSIS β¨
s6-svwait [-U | -u | -D | -d | -r | -R] [-a | -o] [-t timeout]
servicedir...
π¦ DESCRIPTION π¦
s6-svwait only waits for notifications; it never polls. No cap β it's not out here spinning in a loop, it's just listening for the tea β
Give it one or more service directories as arguments β not an s6-scan-directory(7). If you need to wait for a whole scan directory, pass all its contents as arguments to s6-svwait.
Also, heads up: 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. Respect the prerequisites, bestie π«Ά
π OPTIONS π
-uβ Up.s6-svwaitwill wait until the services are up, as reported bys6-supervise(8). This is the default; it is not reliable, but it does not depend on specific support in the service programs. Sees6-notifywhenup(7)for details.-Uβ Really up.s6-svwaitwill 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 thenotification-fdfile in thes6-service-directory(7). See the explanation ins6-notifywhenup(7).-dβ Down.s6-svwaitwill wait until the services are down.-Dβ Really down.s6-svwaitwill wait until the services are down and the cleanup scripts inservicedir/finish for everyservicedirhave finished executing (or have timed out and been killed).-rβ Restart.s6-svwaitwill wait until the services are down, then until they are up. If the-ooption 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-svwaitwill wait until the services are down, then until they are up and ready. If the-ooption 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-svwaitwill wait until one of the given services comes up or down.-aβ And.s6-svwaitwill wait until all of the given services come up or down. This is the default.-t timeoutβ If the requested events have not happened aftertimeoutmilliseconds,s6-svwaitwill print a message tostderrand exit99. By default,timeoutis0, 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. Iconic, honestly β¨
π EXIT STATUS π
0β Success, the wanted state has been reached.99β Timed out.100β Wrong usage.102β Thes6-supervise(8)process monitoring the service died.111β System call failed.nβ Services were expected to come up, butnof 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)
Okay that's the whole page! Brought to you by Debian, dated November 11, 2023, and stamped S6-SVWAIT(8). Byeee, bestie β go wait on some services π
π¦ where this page comes from
- nixpkgs unstable: s6 2.15.1.0
- nixpkgs unstable: s6-man-pages 2.14.0.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms