S6-IPCSERVER(8)
π s6-ipcserver β the UCSPI server tool<sup>[1]</sup> for Unix domain sockets β¨
okay so bestie, picture this: a super-server. It accepts connections from clients on a Unix domain socket, and then forks a little program to handle each and every connection. That's the whole vibe. This is the s6-ipcserver page from the System Manager's Manual, and yes we're gonna get through all of it together π«Ά
πΈ SYNOPSIS πΈ
s6-ipcserver [-1] [-q | -Q | -v] [-d | -D] [-P | -p] [-a perms]
[-c maxconn] [-C localmaxconn] [-b backlog] [-G gidlist]
[-g gid] [-u uid] [-U] path prog...
Like, look at her. Gorgeous. Iconic. All those flags are about to get explained one by one, don't panic π
π¦ DESCRIPTION π¦
So s6-ipcserver binds a Unix domain socket to path. Simple as that.
It can drop its root privileges. Slay, we love a humble queen π
It closes its stdin and stdout. Bye bestie, we don't need those anymore.
For every client connection to this socket, it forks. The child sets some environment variables, then executes prog... with stdin reading from the socket and stdout writing to it. Like a little handoff, very main character energy.
Depending on the verbosity level, it logs what it does to stderr.
It runs until it gets killed by a signal. And depending on the received signal, it may kill its children before exiting. Not a fun vibe but like, necessary π
Here's the tea though: s6-ipcserver actually doesn't do any of this itself. It is a wrapper, rewriting the command line and executing into a chain of programs that perform those duties. It's giving project manager. It delegates, it's fabulous, it takes zero credit β¨
Previous versions of s6-ipcserver were monolithic: it did the work of s6-ipcserver-socketbinder(8), s6-applyuidgid(8) and s6-ipcserverd(8) itself. The functionality has now been split into several different programs because some service startup schemes require the daemon to get its socket from an external program instead of creating and binding it itself. The most obvious application of this is upgrading a long-lived process without losing existing connections. Which is honestly so valid of them π
β¨ OPTIONS β¨
-1β Writes a newline to stdout, before closing it, right after binding and listening to the Unix socket. If stdout is suitably redirected, this can be used by monitoring programs to check when the server is ready to accept connections. It's the "hey bestie I'm ready" signal π-qβ Be quiet. Shhh. π€«-Qβ Be normally verbose. This is the default, iykyk.-vβ Be verbose. Tell me everything, I'm listening π-dβ Allow instant rebinding to the samepatheven if it has been used not long ago β this is theSO_REUSEADDRflag tosetsockopt(2)and is generally used with server programs. This is the default. Note thatpathwill be deleted if it already exists at program start time. Lowkey destructive but she's the default so π-Dβ Disallow instant rebinding to the samepath. The cautious option π¦-Pβ Disable client credentials lookups. TheIPCREMOTEEUIDandIPCREMOTEEGIDenvironment variables will be unset in every instance ofprog.... This is the portable option, because not every system supports credential lookup across Unix domain sockets; but it is not as secure. So like, tradeoff: it works everywhere but it's less safe π-pβ Enable client credentials lookups. This is the default; it works at least on Linux, Solaris, and *BSD systems. On systems that do not support it, every connection attempt will fail with a warning message. Not a vibe check you wanna fail π-cmaxconn β Accept at mostmaxconnconcurrent connections. Default is40. It is impossible to set it higher than1000. That's the ceiling, periodt.-Clocalmaxconn β Accept at mostlocalmaxconnconnections from the same user ID. Default is40. It is impossible to set it higher thanmaxconn. So if you try to be slick, the math says no π-bbacklog β Set a maximum ofbacklogbacklog connections on the socket. Extra connection attempts will rejected by the kernel. (Yes, it says "will rejected", we're quoting the energy, not fixing it π)-aperms β Create the socket with permissionsperms, which is an octal number from0000to0777. Default is0777, meaning everyone can connect to it.0700means only processes having the same uid as thes6-ipcserverprocess can connect to it. Choose your fighter π-Ggidlist β Changes6-ipcserver's supplementary group list togidlistafter binding the socket. This is only valid when run as root.gidlistmust be a comma-separated list of numerical group IDs. Commas, bestie, not spaces β¨-ggid β Changes6-ipcserver's groupid togidafter binding the socket. This is only valid when run as root.-uuid β Changes6-ipcserver's userid touidafter binding the socket. This is only valid when run as root.-Uβ Changes6-ipcserver's user id, group id and supplementary group list according to the values of theUID,GIDandGIDLISTenvironment variables after binding the socket. This is only valid when run as root. This can be used with thes6-envuidgid(8)program to easily script a service that binds to a privileged socket then drops its privileges to those of a named non-root account. Literally the glow-up-from-root pipeline π
π§ IMPLEMENTATION NOTES π§
s6-ipcserver parses the options and arguments it is given, and builds a new command line with them. It then executes into that new command line.
The first program s6-ipcserver executes into is s6-ipcserver-socketbinder(8). It will create and bind a Unix domain socket to path, then execute into the rest of the command line.
If a privilege-dropping operation has been requested, the program that s6-ipcserver-socketbinder(8) executes into is s6-applyuidgid(8). It will drop the root privileges, then execute into the rest of the command line.
The next program in the chain is s6-ipcserverd(8). It is executed into by s6-applyuidgid(8), or directly by s6-ipcserver-socketbinder(8) if no privilege-dropping operation has been requested. s6-ipcserverd(8) is the long-lived process, the "daemon" itself, accepting connections from clients. She's the one who stays. Main character energy, fr fr π
For every client, s6-ipcserverd(8) will spawn an instance of prog..., the remainder of the command line.
ngl this whole chain is giving relay race and every runner slays their leg and hands off the baton. No cap πββοΈβ¨
π SEE ALSO π
s6-accessrules-cdb-from-fs(8)s6-accessrules-fs-from-cdb(8)s6-connlimit(8)s6-ioconnect(8)s6-ipcclient(8)s6-ipcserver-access(8)s6-ipcserver-socketbinder(8)s6-ipcserverd(8)
[1] https://cr.yp.to/proto/ucspi.txt
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-ipcserver.html
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
and that's the whole page bestie!! π written by the icons above, ported over on the Debian side, dated September 29, 2021, from System Manager's Manual β S6-IPCSERVER(8) β mwah, go bind some sockets 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