S6-ENVDIR(8)

πŸ“¦ version 2.15.1.0, in nixpkgs unstable

πŸ‘‘ S6-ENVDIR(8) β€” like, the system manager's manual bestie, we're in the big leagues now

okay so picture this: you want to change your environment and then exec into another program, right? That's the whole gig. s6-envdir is the main character here, and she ate. πŸ’…


✨ SYNOPSIS ✨

s6-envdir [-I | -i] [-n] [-f] [-L] [-c nullis] dir prog...

literally just dir and then prog..., bestie. That's it. That's the whole vibe. 🫢


🌸 DESCRIPTION 🌸

okay so here's what she does: s6-envdir reads the files inside dir. And for every file f in dir that does not begin with a dot and does not contain the = character, she's gonna do one of two things:

  • If f is empty? She removes a variable named f from the environment, if there even is one. Bye bestie. πŸ‘‹
  • Otherwise? She adds a variable named f to the environment (or replaces f if it's already lurking in there) and the value is the first line of the contents of file f. Spaces and tabs at the end of that line get yeeted, along with any trailing newline; and any null characters in that line get changed to newlines in the environment variable. slay. ✨

and ngl, the plot twist is: s6-envdir without any options behaves exactly like envdir[1]. same energy, fr fr. πŸ’€


πŸŽ€ OPTIONS πŸŽ€

  • -i β€” Strict mode. If dir doesn't exist, she exits 111 with an error message. This is the default, so like, that's the vibe you get for free. periodt.
  • -I β€” Loose mode. If dir doesn't exist, she just execs into prog without touching the environment first. no notes, very chill of her. πŸ¦‹
  • -f β€” Verbatim mode. The entire file becomes the value of the environment variable, newlines and all (except the last one, if you didn't pass -n). Null characters are still getting translated though β€” that part doesn't change. πŸ”₯
  • -n β€” Do not chomp. If -f is given and the file ends with a newline, that last newline stays in the value. If -f is not given, she keeps the trailing blanks at the end of the first line (but not the ending newline). so basically, no nibbling. πŸ™ˆ
  • -L β€” Do not clamp. With this one, s6-envdir will process the whole first line of each file (if -f hasn't been given) or read each file entirely (if -f has been given) β€” even if it means adding huge variables to the environment. Without this option, she only reads the first 4096 bytes of each file. so like, -L is the "no thoughts, full send" flag. 😭
  • -c nullis β€” Replace null characters with the first character of nullis instead of a newline. cute little custom substitution moment. πŸ“
⚠️ real talk: -L will genuinely let you stuff massive variables into your environment, and that's on purpose. She's not gonna stop you. Just know what you're asking for.

πŸ¦‹ SEE ALSO πŸ¦‹

s6-applyuidgid(8), s6-envuidgid(8), s6-fghack(8), s6-setsid(8), s6-setuidgid(8), s6-softlimit(8), s6-tai64n(8), s6-tai64nlocal(8)

[1] https://cr.yp.to/daemontools/envdir.html

this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-envdir.html β€” iykyk, go read the source of truth. πŸ’œ


🌈 AUTHORS 🌈

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

and that's the whole thing, bestie β€” no cap, every flag documented, every detail intact, iconic behavior only. πŸ’–βœ¨

Debian Β· March 13, 2022 Β· she's giving S6-ENVDIR(8) and she's serving it fr fr. πŸŽ€πŸŒΈπŸ’…

πŸ“¦ where this page comes from