S6-SETSID(8)

πŸ“¦ version 2.15.1.0, in nixpkgs unstable

πŸ’… s6-setsid β€” the manual page, but make it a group chat

okay so bestie, this is s6-setsid from the System Manager's Manual section 8, and it's genuinely one of those little tools that's doing the most while looking like it's doing nothing. Let's get into it ✨


🌸 NAME 🌸

s6-setsid β€” run a program as a new session leader, or in a new foreground or background process group 🫢


πŸŽ€ SYNOPSIS πŸŽ€

s6-setsid [-s | -b | -f | -g] [-i | -I | -q] [-d ctty] prog...

✨ DESCRIPTION ✨

So here's the vibe: s6-setsid creates a new session, or a new process group, and it may make that process group the foreground process group β€” depending on which options you run it with. Iconic, flexible, does both πŸ’…

As session leader or process group leader, s6-setsid then executes into prog.... Yes, it execs. It doesn't stick around babysitting, it hands the whole thing over and leaves. Periodt.


πŸ’– OPTIONS πŸ’–

  • -s β€” Session. s6-setsid will try and execute prog as a session leader. This is the default, so if you're not specifying anything, this is what you're getting ⭐
  • -b β€” Background process group. s6-setsid will not create a new session, but will create a new process group, and try and execute prog as the new process group leader. Lowkey the shy option πŸ¦‹
  • -f β€” Foreground process group. s6-setsid will not create a new session, but will create a new process group and attach its session's controlling terminal to the new process group before executing prog.
⚠️ But listen β€” the new process group will likely be stopped, waiting for the former foreground process group to relinquish the controlling terminal, and will need to be sent a SIGCONT to resume. 😭 To avoid that whole situation, use the next option.
  • -g β€” Grab terminal. s6-setsid will not create a new session, but will create a new process group and attach its session's controlling terminal to the new process group before executing prog. It will forcefully grab the controlling terminal from the former foreground process group: a process belonging to that former foreground process group will be stopped if it attempts to read from or write to that terminal. Not me snatching the terminal πŸ’€ main character energy fr fr
  • -i β€” Strict. If s6-setsid cannot perform the operations it needs, it will exit 111 with an error message. No warnings, we go straight to the error code πŸ™ˆ
  • -I β€” Loose. If s6-setsid cannot perform the operations, it will print a warning message, but exec into prog nonetheless. This is the default β€” go with the flow, keep it moving πŸ“
  • -q β€” Silent. s6-setsid will not print any warning message; it will exec into prog even if it cannot perform the operations. Shhh 🀫
  • -d ctty β€” Assume file descriptor number ctty is the controlling terminal for the current session. Default is 0. This is only useful when used with the -f or -g options. Iykyk 🧚

🌈 SEE ALSO 🌈

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-setsid.html β€” go read the source, it's giving academic but in a good way πŸ“šπŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

Laurent Bercot

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


okay that's the whole page, no cap, every flag accounted for πŸ”₯

πŸ’Œ cute sign-off: this beauty comes from Debian, dated September 29, 2021, and it's the S6-SETSID(8) page itself. Slay, stay hydrated, and always SIGCONT your stopped process groups πŸ’–πŸŽ€
πŸ“¦ where this page comes from