S6-ENVUIDGID(8)
π S6-ENVUIDGID π
okay so bestie, welcome to s6-envuidgid(8), aka the System Manager's Manual page you're about to absolutely devour. she's a little tool that maybe sets the UID, GID and GIDLIST environment variables based on whatever options and arguments you hand her, and then she executes into another program. slay.
β¨ NAME β¨
s6-envuidgid β potentially set the UID, GID and GIDLIST environment variables according to the options and arguments it is given, then execute into another program π«Ά
πΈ SYNOPSIS πΈ
s6-envuidgid [-u | -g | -B] [-n] [-i | -D uid:gid:gidlist] account
prog...
π¦ DESCRIPTION π¦
so here's the vibe: s6-envuidgid looks account up by name in the account database. iconic behavior honestly.
it sets the UID environment variable to account's uid, and the GID environment variable to account's gid. yes bestie, both.
it also sets the GIDLIST environment variable to a comma-separated list of supplementary group ids that account is a member of, according to the group database. and listen β if account doesn't belong to any other group than its primary group, GIDLIST is still set, it's just empty. she shows up either way, periodt. π
then it executes into prog.... that's the whole arc.
s6-envuidgid without options behaves like envuidgid[1], except that the exit code is 1 if account doesn't exist, and it also exports supplementary groups. two little upgrades, no cap.
s6-envuidgid is useful when running a program that must start as root but can drop its privileges later. such a program can read its new uid/gid/groups info from the UID, GID and GIDLIST environment variables. super-servers such as s6-tcpserver(8) make use of this. main character energy fr fr π
π OPTIONS π
-uβ User.accountwill be interpreted as a user name; theUIDenvironment variable will be set to its numerical value, and theGIDandGIDLISTvariables will not be touched. hands off, she's just doing user stuff π-gβ Group.accountwill be interpreted as a group name instead of a user name; theGIDenvironment variable will be set to its numerical value, and theUIDandGIDLISTvariables will not be touched.-Bβ Both user and group.accountwill be interpreted as'user:group'. theGIDLISTvariable will not be touched. ifuserdoes not exist, theUIDvariable will be set to0unless a better default is provided with the-Doption. ifgroupdoes not exist, theGIDvariable will be set to0unless a better default is provided with the-Doption. defaults, but make them cute β¨-nβ Numerical fallback. ifaccountcannot be found in the user or group database, try to interpret the given values literally. for instance,s6-envuidgid -B root:42will fail if there's no group named'42'in the group database, buts6-envuidgid -nB root:42will setUIDto0andGIDto42. literally the save of the century π-iβ Insist. ifaccountis unknown, exit1with an error message. this is the default. she's stubborn and that's valid π-D uid:gid:gidlistβ ifaccountis unknown, useuid,gidandgidlistas the values forUID,GIDandGIDLIST. your custom defaults, your rules π
π SEE ALSO π
s6-applyuidgid(8), s6-envdir(8), s6-fghack(8), s6-setsid(8), s6-setuidgid(8), s6-softlimit(8), s6-tai64n(8), s6-tai64nlocal(8), s6-tcpserver(8)
[1] https://cr.yp.to/daemontools/envuidgid.html
this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-envuidgid.html
π AUTHORS π
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)
and that's the whole page, bestie, you ate π the source is Debian, dated April 16, 2024 β S6-ENVUIDGID(8) β go forth and drop those privileges 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