[systemd-devel] file-hierarchy. user persistent data dir.

Colin Guthrie gmane at colin.guthr.ie
Fri Jul 4 06:46:11 PDT 2014


'Twas brillig, and Michael Biebl at 04/07/14 14:13 did gyre and gimble:
> 2014-07-04 14:21 GMT+02:00 Simon McVittie <simon.mcvittie at collabora.co.uk>:
>> On 04/07/14 11:33, Lennart Poettering wrote:
>>> ~/.config: state and configuration, the counterpart for both /etc/ *and*
>>>            /var/lib/ in the home directory
>>>
>>> ~/.local: static vendor resources of additional packages installed into
>>>           the home directory. Should be considered read-only except when
>>>           new packages are installed or removed from the home
>>>           directory. The counterpart of /usr/ in the home directory.
>>
>> This is not, in practice, what happens: I certainly have a lot of state
>> (/var/lib-like) in my ~/.local/share.
> 
> Indeed. When looking through my ~/.local/share there are a lot of state files.
> 
> Actually, the majority of applications that I use treat ~/.local as
> app state directory, only a very seem to use ~/.config for that.
> 
> This clearly needs clarification in the XDG spec.

I think ~/.local/share sounds like it *should* be similar to
/usr/{lib,share}/ and there should be a different tree for state, e.g.
~/.local/var, but as people have pointed out this is not the behaviour
in practice.

The names "usr" and "var" don't really convey much these days so perhaps
~/.local/share should be deprecated and symlinked to ~/.local/resources
which is defined for read-only resources and ~/.local/state becomes a
new folder to store state.

Actually ~/.local/share should probably be symlinked to ~/.local/state
initially, (to preserve old behaviour) and thus allow read/write access
under sandboxing and not break any existing applications.

It would IMO have been nicer if .config lived inside .local as
~/.local/config that way the whole .local tree is what matters. Of
course "local" is still a shit name IMO but then I always think the
bikeshed should have stripes.

So perhaps we should define ~/.local as the top level tree with the
subfolders "config", "state", "resources". Each is clearly defined,
~/.config can be changed to be a symlink to ~/.local/config and
~/.local/share can be a symlink to "state" (although the name "share"
suggests it should really be symlinked to "resources", it's usage "in
the wild" means that symlinking it to "state" is safer until the changes
trickle through). [Side note: I do have some files in ~/.local/lib too
related to python]

Either way, the underspecification in XDG (I have other complaints
regarding the cache folder handling too but that's another rant) is not
ideal and definitive clarification would help.

It should definitely be discussed with the GNOME and KDE (+$other) guys
tho' (as session managers would have to ensure the proper work was done
to convert users' directory layouts, so this be handled carefully).

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list