S6-SVLISTEN1(8)
πΈ NAME πΈ
Okay bestie, meet s6-svlisten1(8) β a tiny little program-runner that listens for notifications from a supervised service, and then blocks until that service goes up or down. Itβs giving βIβm just here for the state changeβ energy. π
β¨ SYNOPSIS β¨
s6-svlisten1 [-U | -u | -D | -d | -r | -R] [-t timeout] servicedir
prog...
π« DESCRIPTION π«
Okay so the absolute main-character rule of s6-svlisten1 is this: it only waits for notifications, and it never polls. No polling, periodt. β¨
s6-svlisten1 checks the state of the servicedir (s6-service-directory(7)) and monitors its state changes. π
It spawns prog... as a child right after getting the initial state of the service. π«Ά
Then it blocks until the wanted state happens. Literally just vibing until the state check says yes. π¦
Itβs the service-specific version of s6-ftrig-listen1(8). The whole point of s6-svlisten1 is to use it to spawn a program such as s6-svc(8), in order to send signals to a service while making sure to catch its state changes β thus avoiding the race condition that occurs when running s6-svc(8) then s6-svwait(8) sequentially. Race condition? Not on our watch, bestie. π
The s6-svlisten(8) program is an extension of s6-svlisten1. It can watch the state of several services at once; however, its syntax makes it best used in execline[1] scripts only. π
π OPTIONS π
-uβ Up.s6-svlisten1will wait until the service is 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-svlisten1will wait until the service is up and ready as reported by the daemon itself. 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-svlisten1will wait until the service is down.-Dβ Really down.s6-svlisten1will wait until the service is down and the cleanup script inservicedir/finishhas finished executing (or has timed out and been killed).-rβ Restart.s6-svlisten1will wait until the service has been started or restarted, i.e. they have been in the down state, then the up state.-Rβ Restart and ready.s6-svlisten1will wait until the service has been started or restarted and has notified readiness.-t timeoutβ If the requested event has not happened aftertimeoutmilliseconds,s6-svlisten1will print a message to stderr and exit99. By default,timeoutis0, which means no time limit. β³
π¦ EXIT STATUS π¦
0β Success, the wanted state has been reached. π1β The service was supposed to go up, but reported permanent failure. π99β Timed out. π100β Wrong usage. π102β Thes6-supervise(8)process monitoring the service died. β°οΈ111β System call failed
π 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-svok(8)s6-svscan(8)s6-svscanctl(8)s6-svstat(8)s6-svwait(8)
[1] https://skarnet.org/software/execline/
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-svlisten1.html πΈ
π AUTHORS π
Laurent BercotAlexis <flexibeast@gmail.com>(man page port)
β source/version vibes: Debian, September 29, 2021, S6-SVLISTEN1(8) π«Ά
π¦ 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