S6-IPCSERVER-SOCKETBINDER(8)

πŸ“¦ version 2.15.1.0, in nixpkgs unstable

πŸ’– s6-ipcserver-socketbinder(8) β€” System Manager's Manual πŸ’–

okay so bestie, welcome to the s6-ipcserver-socketbinder(8) page from the System Manager's Manual β€” yes, section 8, Unix-admin main character energy πŸ”₯


✨ NAME ✨

s6-ipcserver-socketbinder β€” bind a Unix domain socket, then execute a program 🫢


🌸 SYNOPSIS 🌸

s6-ipcserver-socketbinder [-d | -D] [-b backlog] [-M | -m] [-a perms]
                          [-B] path prog...

πŸ¦‹ DESCRIPTION πŸ¦‹

So s6-ipcserver-socketbinder creates a Unix domain socket and binds it to path. It gets the socket ready to accept connections by calling listen(2) β€” lowkey iconic behavior πŸ’…

Then it execs into prog... with the open socket as its standard input. periodt.

The socket is provided non-blocking by default. ✨

s6-ipcserver-socketbinder is part of a set of basic blocks used to build a flexible Unix super-server. It normally should be given a command line crafted to make it execute into s6-ipcserverd(8) to accept connections from clients, or into a program such as s6-applyuidgid(8) to drop privileges before doing so. it's giving modular, reusable, slightly chaotic but in a good way 🧚

The s6-ipcserver(8) program does exactly this. It implements a full Unix super-server by building a command line starting with s6-ipcserver-socketbinder and ending with s6-ipcserverd(8) followed by the application program, and executing into it. no cap, that's the whole trick πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

  • -d β€” Allow instant rebinding to the same path even if it has been used not long ago. This is the SO_REUSEADDR flag to setsockopt(2) and is generally used with server programs. This is the default. Note that path will be deleted if it already exists at program start time. πŸ™ˆ
  • -D β€” Disallow instant rebinding to the same path. simple as that πŸ’€
  • -b backlog β€” Set a maximum of backlog connections on the socket β€” extra connection attempts will rejected by the kernel. The default is SOMAXCONN, i.e. the maximum number allowed by the system. If backlog is 0, then the socket will be created, but it will not be listening. okay so -b 0 is not a vibe for listening, it's a vibe for "created but not listening" πŸ“
  • -M β€” The type of the socket will be SOCK_STREAM. This is the default. πŸ’–
  • -m β€” The type of the socket will be SOCK_DGRAM. Note that by default SOCK_DGRAM sockets are not connection-mode, and listen(2) will fail β€” so you should always give the -b0 option to s6-ipcserver-socketbinder along with -m. literally do not forget this combo, bestie 😭
>! -m without -b0? the original says listen(2) will fail, so that's the warning. take it seriously πŸ’… > > well, close enough: SOCK_DGRAM plus default connection-mode hopes = listen(2) fail. give it -b0 with -m.
  • -a perms β€” Create the socket with permissions perms, which is an octal number from 0000 to 0777. Default is 0777, meaning everyone can connect to it. 0700 means only processes having the same uid as the s6-ipcserver-socketbinder process can connect to it. permission check slay πŸ”
  • -B β€” The socket will be blocking. The default is nonblocking. okay so -B is the "blocking mode" switch, and without it you're on nonblocking by default ✨

🌈 SEE ALSO 🌈

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-ipcserver-socketbinder.html πŸ¦‹


πŸ‘‘ AUTHORS πŸ‘‘

  • Laurent Bercot
  • Alexis <flexibeast@gmail.com> (man page port)

mwah πŸ’‹ β€” this page comes from Debian, dated September 29, 2021, with S6-IPCSERVER-SOCKETBINDER(8) in the footer. bye bestie, go bind that socket responsibly πŸŽ€

πŸ“¦ where this page comes from