1. 49

  2. 16

    Then somebody decided /usr/local wasn’t a good place to install new packages, so let’s add /opt! I’m still waiting for /opt/local to show up…

    MacPorts lives in /opt/local. The prophecy is true.

    1. 11

      There exists an updated version of this text, which i reposted in my blog[1]. That one was written for some printed issue and i transcribed it back from PDF to txt.

      [1] https://blog.w1r3.net/2018/01/06/rob-landley-about-usr-split.html

      1. 10

        My only real complaint about getting rid of the /usr split is that /usr still exists as something other than a symlink to /. The name /usr is basically meaningless. If you aren’t going to support /usr on a separate partition, why bother having /usr at all? Just shallow your hierarchy:

        • /bin
        • /dev
        • /local
        • /share
        • and so forth

        Keep /usr as a symlink to / for compatibility. I’ve suggested this to folks a few times over the years and haven’t gotten much response. By symlinking /bin and friends, you keep /usr as a naming convention, even though as Landley’s post points out, it is one that has lost its relevance.

        1. 2

          Having a separate /usr leads to a system of layered configuration. You have the distributor-originating artifacts in /usr, you have your configs in /etc, and local databases/pods/containers/caches/spools/etc. in /var.

          Also see systemd-tmpfiles(8).

          Coincidentally something I recall from Haiku.

          1. 3

            From a 60ies/70ies UNIX perspective, I can understand this line of reasoning (limited disk space, more primitive file systems). But we can just put every application/configuration in its own flat filesystem namespace to avoid name clashes. It also makes it possible to have multiple versions of applications or configuration files available at the same time.

            (E.g. nix and guix follow this approach and to a lesser extend macOS application bundles.)

            1. 3

              The central problem with just refactoring the file system structure to something that makes more intuitive sense from a high-level view is that it makes life a living hell for package maintainers. They have to grind through the process of not just making sure binaries and libraries get where they should be, they also have to make sure that the software will actually work correctly with things moved around. Some software (especially stuff using autoconf) can deal with this pretty okay, but other stuff is more nightmarish. The closer your system is to “legacy,” the more likely $random_third-party_app is likely to more or less work out of the box.

          2. 1

            having circular symlinks can create some interesting tarballs, or make the linker recurse through it a few times.

          3. 3

            In early versions of Unix, some binaries appear to have been under /etc — see rkd in the man pages for an example https://www.bell-labs.com/usr/dmr/www/man13.pdf

            1. 3

              There still sort of is, at least on my AIX system. /etc/ping is symlinked, as is route and (interestingly) uucpd. Gotta get around to getting UUCP running.

              1. 1

                My friend set up UUCP on AIX…. provided you’re running AIX on an RT/PC.

            2. 1

              I feel having /usr/local inside /usr is a bit weird (alternatives: /local or /opt). Dealing with many makefiles hardcoded to /usr/local would be a lot of effort, however.

              It’s the problem of file-tidying. On a home machine we can re-arrange our personal files as much as we want. On an HTTP server we have to resist any sort of tidying, no matter how trivial, because this breaks URLs.

              1. 1

                given tons of programs still just emit configurations and other content into personal $HOME/.$some_program, I’m not even sure of the former part of your last statement. at least with url’s you can configure 301 redirects.

              2. 1

                I install everything /var/pack/pkg/// (and then I install them in /bin).

                So with a few workarounds, you can definitely have something else than /usr/local or /usr as installation prefix.

                With autotools, it’s configure --prefix=/ and with most of the others, it is make PREFIX=/.

                Out of compiled programs, I only install the /bin and /man and it works very well.

                At UNIX design time, there were only one team, so the OS and the package managers are made by different persons.

                1. 0

                  Rob Landley is the guy who convinced me to start learning Python at a conference panel some 15 years ago. Which has no bearing whatsoever on the content of the post, just something that popped into my head while reading it.