alexlarsson/xdg-app

Is /var/xdg-app a typo?

Closed this issue · 3 comments

trans commented

In https://wiki.gnome.org/Projects/SandboxedApps there is line that says: "System-wide installations end up in /var/xdg-app, while..." but that location doesn't seem right, and seems to contradict prior explanation. Is it perhaps a mistake? And it is supposed to be "/usr/local/xdg-app", instead?

I'm not sure what prior explanation you think it contradicts? We used to place the system wide installs of apps in /usr/share/xdg-app, but that is not a great place if you're using a read-only /usr, so instead we moved this to /var, which should always be writable.

trans commented

​Under Concepts it reads, "Both runtimes and app bundles can be installed per-user and system-wide. With the way things are currently set up, per-user installations end up in $HOME/.local/share/xdg-app/ and system-wide installations in /usr/share/xdg-app."

/usr is only read-only to non-root users, so isn't that the proper system-wide install location according to FHS? Though maybe /usr/local/ makes more sense if it is done by hand rather than by the OS.

Ah, thanks. I updated that reference to point to /var too.

Both /usr and /var are generally read-only to non-roots, in that sense they are the same. However, in recent years there has been a lot of work from various parties to have /usr be completely read-only, where any updates to the system would be an atomic switch to a new /usr. This can be done in many ways, such as loopback image mounts, btrfs snapshots, ostree-like hardlink farms, etc. This has been popularized by projects such as coreos and atomic, as well as nix.

In such a setup the installation of apps will be "separate" from the host os, and make more sense in /var (i.e. treat it like data).