[RFC] XDG_RUNTIME_DIR

Kevin Krammer kevin.krammer at gmx.at
Sun Nov 7 07:15:08 PST 2010


On Saturday, 2010-11-06, Lennart Poettering wrote:
> Heya,
> 
> Ryan Lortie and I have been sitting down here at the GNOME Summit and
> have discussed an older proposal that was posted on the XDG ML by Ryan a
> while back, regarding definition of a directory where user applications
> can store runtime files and other file objects (sockets, ...) in. That
> directory should be machine-local, fully-featured (i.e. not on NFS) and
> its lifetime should be bound to the user actually being logged in. It is
> as such something like a per-user counterpart of /var/run.

Something like this sounds extremely useful.

> So, here's what we propose: some kind of session manager should set
> $XDG_RUNTIME_DIR for all user processes to a directory for which the
> following rules apply:

Maybe XDG_RUNTIME_HOME, since all other user specific directory variables in 
the spec are suffixed with _HOME?

> - It is owned by the user and the user is the only one having write
> access to it
> 
> - The directory may be deleted (and should be deleted) after the user
> fully logged off or the machine is shut down.
> 
> - The directory is on a local file system, and not shared with other
> machines.
> 
> - The directory is fully featured, i.e. the majority of file system
> features the OS provides should be supported on it. More precisely, on
> Unix AF_UNIX sockets, symlinks, proper permissions, file locking,
> sparse files, mmap, hard link count must be available. (It is in fact
> recommended to use tmpfs or something similar as backing file system)
> 
> - Files in the directories may be deleted by the OS if they are older
> than 12h. If an app wants to make sure that files it creates shall
> stay around longer it should update the mtime at least every 6h, or
> alternatively set the file sticky bit on the file.

What if the system resumes from suspend after 12 hours and the OS job to clean 
the directory is executed before any of the apps had a chance to update mtime?

> - Applications making use of this feature which do not find
> $XDG_RUNTIME_DIR to be set, should fall back to some other directory
> providing similar capabilities, and print a warning.

Is there a way to specify this "some other directory"? Otherwise the ability 
to discover paths safely is lost if apps use differnent procedures to come up 
with "some other directory".

Cheers,
Kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20101107/c13c3859/attachment.pgp>


More information about the xdg mailing list