S6-SETSID(8)
π 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-setsidwill try and executeprogas 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-setsidwill not create a new session, but will create a new process group, and try and executeprogas the new process group leader. Lowkey the shy option π¦-fβ Foreground process group.s6-setsidwill 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 executingprog.
β οΈ 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-setsidwill 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 executingprog. 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. Ifs6-setsidcannot perform the operations it needs, it will exit111with an error message. No warnings, we go straight to the error code π-Iβ Loose. Ifs6-setsidcannot perform the operations, it will print a warning message, but exec intoprognonetheless. This is the default β go with the flow, keep it moving π-qβ Silent.s6-setsidwill not print any warning message; it will exec intoprogeven if it cannot perform the operations. Shhh π€«-dcttyβ Assume file descriptor numbercttyis the controlling terminal for the current session. Default is0. This is only useful when used with the-for-goptions. Iykyk π§
π SEE ALSO π
s6-applyuidgid(8)s6-envdir(8)s6-envuidgid(8)s6-fghack(8)s6-setuidgid(8)s6-softlimit(8)s6-tai64n(8)s6-tai64nlocal(8)
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 theS6-SETSID(8)page itself. Slay, stay hydrated, and alwaysSIGCONTyour stopped process groups ππ
π¦ 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