S6-UPDATE-SYMLINKS(1)

NAME
s6-update-symlinks - link the content of several similar directory trees under a single tree

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

DESCRIPTION
s6-update-symlinks links the content of several similar directory trees under a single tree. Its main use is to replace search paths like PATH or MANPATH, by creating a unique access tree based on the source trees. Name conflicts are solved by giving precedence to the last named directory. Subdirectories are created exactly as needed; what can be shared is shared.

s6-update-symlinks is useful when one wants to combine a logical package system, like Dan Bernstein's ‘/package’ [1] and ‘/command’ [2], with physical filesystem constraints, like /, /usr and /usr/local on separate filesystems.

d is the destination directory. It will be created if it doesn't exist.

src1, src2, ... are the directory containing the files to be linked. d and srcn must be absolute paths, else s6-update-symlinks refuses to run. Using relative paths doesn't make sense here, anyway.

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.

If s6-update-symlinks manages to performs all the requested tasks, it exits 0. If it encounters a hard error, it exits 111. If it is 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.

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".

    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/.

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

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