S6-SVUNLINK(8)
π s6-svunlink β like, the manual page, bestie β¨
okay so this is the s6-svunlink page from section 8 (System Manager's Manual), and it's literally all about unhooking a service directory from your service manager sequence without the race conditions ruining your whole day π«Ά
πΈ NAME πΈ
s6-svunlink β integrate service directories into an existing service manager sequence and eliminate race conditions
β¨ SYNOPSIS β¨
s6-svunlink [-X] [-t timeout] scandir name
π DESCRIPTION π
So s6-svunlink unlinks an s6-service-directory(7) from an s6-scan-directory(7), and then it notifies s6-svscan(8) that a service has been unregistered. After that it just waits β patiently, like a good bestie β until the s6-supervise(8) supervisor process managing the service has disappeared, and then it exits. iconic behavior honestly π
Here's the whole glow-up sequence, step by step:
s6-svunlinkexpects a runnings6-svscan(8)process on scandir and a fully functional supervised service on thes6-service-directory(7)inscandir/name, which must be a symbolic link to a real directory located somewhere else. no fake links, no games, fr fr.- It deletes the
scandir/namesymlink. gone. bye. π - It sends a command to
s6-svscan(8)to signal it that a service has disappeared. - It waits for the
s6-supervise(8)process managing the service directory to exit. - It exits
0. slay.
π«Ά real talk: usings6-svunlinkto stop services is a suboptimal pattern, and I need you to hear me on this. starting and stopping supervisors is a heavier operation than just stopping services. the simpler, more efficient pattern is to simply performs6-svc -dwD scandir/name, which only commands, and waits for, the death of the service, without impacting the supervisor. no cap.
but nevertheless β for symmetry with s6-svlink(8), this program is provided. fairness! balance! the algorithm demands it π
Okay now the part that's a little unhinged but you gotta respect it: s6-svunlink is a destructor; as is, it returns 0 even in situations that are nominal failures. for instance, it returns 0 even if its timeout expires π the rationale is that there is no sensible action for the user to do if this error is reported. like, what are you gonna do, bestie? nothing. so it spares you. s6-svunlink only reports errors when they uncover a deeper problem in the system. it's giving "I only raise my voice when it actually matters" π
Also important: s6-svunlink sends a s6-svscanctl -an command to scandir, which means that the system's view of services will be refreshed and inactive services will be killed and unsupervised π₯ depending on what links exist in scandir, new services may appear, and other services than name may disappear. so like... side effects. keep that in mind, iykyk π
π OPTIONS π
-Xβ Don't wait.s6-svunlinkwill exit right away, without waiting for the supervisor to exit first. main character energy: it does not wait for anyone β¨-ttimeout β If the supervisor has not exited after timeout milliseconds,s6-svunlinkwill still exit. The default is0, meaning no time limit. so it'll wait forever unless you tell it otherwise β set it, bestie π
β EXIT STATUS β
0β Success. π100β Wrong usage. oops π111β System call failed. π
π¦ SEE ALSO π¦
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-svunlink.html
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
π and that's the whole page! brought to you by Debian, dated September 29, 2021 β mwah, go unlink something responsibly π β¨π
π¦ 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