GNOME Bugzilla – Bug 763539
GLib should support stateless XDG directories by default
Last modified: 2018-05-24 18:40:24 UTC
Created attachment 323763 [details] [review] Support a stateless configuration by default With this change we support stateless XDG directories by default. Stateless systems separate "vendor" configuration from the local system administrator configuration, facilitating smoother upgrade processes. Given that XDG config files typically involve "/etc/xdg/autostart" files, these are invariably provided by upstream vendors by way of packages, and the administrator of the local system is free to provide their own overrides locally in the /etc/ tree. This facilitates pure stateless implementations where it is forbidden to ship files in /etc/ through the vendor update mechanism. For more information see: https://clearlinux.org/features/stateless The immediate benefit of this change is the deprecation of vendor-packaging of /etc/xdg/autostart-esque files, and instead allows packaging of /usr/share/xdg, preventing potential three-way merges during updates in all packages using this. As an example, the Budgie Desktop now uses a stateless configuration for the xdg files: https://github.com/solus-project/budgie-desktop/commit/b1f9f5b808b5b6c8e70f6677a0ee22dab555017b This change also works throughout XFCE.
The default value for this in absence of XDG_CONFIG_DIRS is taken from the basedir spec. If we want to change this, we should update the spec to match.
Sure, how best to achieve this?
You'll have to start the discussion on adding /usr/share/etc to the default XDG_CONFIG_DIRS value on xdg list: https://lists.freedesktop.org/mailman/listinfo/xdg It would help to get buy in from maintainers of the spec, and maybe other distro maintainers, as well.
So what I've been using in Clear Linux and Solus is actually /usr/share/xdg In place of: /etc/xdg "Default" trees find themselves in: /usr/share/defaults So for example, base profile files: /usr/share/defaults/etc/profile Namespaced: /usr/share/defaults/nano/nanorc Where packages provide a $(datadir) use already: /usr/share/pulseaudio/default.pa Having multiple etc trees under $(datadir) makes little sense, hence /usr/share/xdg
I haven't looked at the details, but I think calling things like this "stateless" is confusing. It's a vague term, and I find myself in a perpetual battle trying to tell people that OSTree isn't "stateless". How about we call this "systemd-style config file overrides"? Regardless of terminology though, I'm definitely in favor of this.
BTW, if it's "systemd style", then we should also support `/run/xdg`.
Well, from my angle with Clear Linux, it is stateless. And not relying on /etc/ at all, is stateless. Note that we don't rely on populating an /etc/ on boot within Clear Linux via systemd tmpfiles, factory files, etc, but can quite easily run without one at all. The diff begins to appear when using, for example, 'passwd', at which point the relevant shadow files are constructed. New thread on xdg mailing list per request :) https://lists.freedesktop.org/archives/xdg/2016-March/013687.html
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1146.