S6-UPDATE-SYMLINKS(1)

πŸ“¦ version 2.3.1.2, in nixpkgs unstable

okay so first things first: this is s6-update-symlinks(1), from the General Commands Manual, and it's genuinely one of those tools that looks scary and then turns out to be iconic. let's get into it πŸ’…

✨ NAME ✨

s6-update-symlinks β€” links the content of several similar directory trees under a single tree. that's the whole vibe.

🌸 SYNOPSIS 🌸

s6-update-symlinks d src1 src2 [...]

πŸ’– DESCRIPTION πŸ’–

so s6-update-symlinks links the content of several similar directory trees under a single tree. main character use case? replacing search paths like PATH or MANPATH by creating one unique access tree based on the source trees. name conflicts get solved by giving precedence to the last named directory. subdirectories are created exactly as needed, and what can be shared is shared. no wasting, no cap.

it's useful when you wanna combine a logical package system β€” like Dan Bernstein's /package[1] and /command[2] β€” with physical filesystem constraints, like /, /usr and /usr/local living on separate filesystems. yes bestie, that's the whole point.

  • d is the destination directory. it will be created if it doesn't exist. πŸŽ€
  • src1, src2, ... are the directories containing the files to be linked. d and srcn must be absolute paths, else s6-update-symlinks refuses to run. and honestly? using relative paths doesn't make sense here anyway.

now the rules of the game, fr fr:

  • if src2 is empty, then d becomes a link to src1.
  • if src1 is empty or entirely overridden by src2, then d becomes a link to src2.
  • if src1/file exists but not src2/file, then d becomes a real directory and d/file a link to src1/file. then if src2/file2 exists, d/file2 links to it.
  • and so on with other src directories, and subdirs. πŸ”

exit status tea β˜•: if s6-update-symlinks manages to perform all the requested tasks, it exits 0. if it encounters a hard error, it exits 111. if it's unable to resolve a conflict between given sources, it exits 100.

πŸ”₯ EXIT STATUS πŸ”₯

  • 100 β€” Unable to resolve conflict between sources.
  • 111 β€” Temporary error.
  • 100 β€” Permanent error, such as a misuse. (yes, 100 shows up twice in this page β€” that's literally what the doc says, so I'm not touching it πŸ’€)
  • 127 β€” Unable to execute program - not found.
  • 126 β€” Unable to execute program - other reason.

🫢 EXAMPLES 🫢

s6-update-symlinks /command /bin /sbin /usr/bin /usr/sbin
/usr/local/bin /usr/local/sbin

makes all files under /bin, ..., /usr/local/sbin available under /command. the programs linked are the same as the ones that would be accessed with PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin". obsessed. ✨

s6-update-symlinks /package /initrd/package /slash/package
/usr/package /usr/local/package

builds a /package hierarchy with what it finds in the listed directories. this allows oddities like, for instance, having the daemontools sources in /usr/package/admin/daemontools/src, and the daemontools binaries in /initrd/package/admin/daemontools/bin, but accessing both through /package/admin/daemontools/. literally the dream setup πŸ˜­πŸ’œ

🌈 SEE ALSO 🌈

s6-basename(1), s6-cat(1), s6-chmod(1), s6-chown(1), s6-clock(1), s6-cut(1), s6-dirname(1), s6-dumpenv(1), s6-echo(1), s6-env(1), s6-expr(1), s6-false(1), s6-format-filter(1), s6-grep(1), s6-head(1), s6-hiercopy(1), s6-linkname(1), s6-ln(1), s6-ls(1), s6-maximumtime(1), s6-mkdir(1), s6-mkfifo(1), s6-nice(1), s6-nuke(1), s6-pause(1), s6-printenv(1), s6-quote(1), s6-quote-filter(1), s6-rename(1), s6-rmrf(1), s6-seq(1), s6-sleep(1), s6-sort(1), s6-sync(1), s6-tai64ndiff(1), s6-tail(1), s6-touch(1), s6-true(1), s6-uniquename(1), s6-unquote(1), s6-unquote-filter(1), seekablepipe(1)

[1] https://cr.yp.to/slashpackage.html

[2] https://cr.yp.to/slashcommand.html

this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-portable-utils/s6-update-symlinks.html β€” ty to the source, always πŸŽ€

πŸ‘‘ AUTHORS πŸ‘‘

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


and that's the page, bestie πŸ’– huge shoutout to the Debian crew β€” this one's stamped Debian, dated April 18, 2022, and it lives under S6-UPDATE-SYMLINKS(1). now go forth and symlink slay βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from