S6-SVWAIT(8)

πŸ“¦ version 2.15.1.0, in nixpkgs unstable

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-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. Iconic, honestly ✨

πŸ’… 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)

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