Bug 14110 - Use XDG dirs instead of $HOME
Summary: Use XDG dirs instead of $HOME
Status: NEW
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
Depends on:
Reported: 2012-05-15 00:01 UTC by william.jon.mccann
Modified: 2014-03-17 15:13 UTC (History)
3 users (show)

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description william.jon.mccann 2012-05-15 00:01:38 UTC
Seems to currently use ~/.systemtap. It would be better to use the locations defined in the XDG Base Directory specification. 

Comment 1 Mark Wielaard 2012-05-15 11:32:04 UTC
There seems to be already some support for XDG:

commit 6ac63adf14504a7a3fd156a5c274c5aa53cbdec0
Author: Lukas Berk <lukas@toomuchcaffeine.(none)>
Date:   Tue Jun 8 15:10:19 2010 -0400

    added the XDG_DATA_DIRS to session.cxx and the corresponding man changes as specified in bug #11455
Comment 2 william.jon.mccann 2012-05-15 13:24:27 UTC
Yeah. Those are the system data dirs. Now we need support for the per-user directories.
Comment 3 Eric Heintzmann 2012-12-08 12:55:04 UTC
What is planned now about FreeDesktop XDG basedir specification for systemtap?

Comment 4 Eric Heintzmann 2013-01-05 13:18:18 UTC
According to XDG Base directory specification:
User data should go into $XDG_DATA_HOME (which default to ~/.local/share),
user preferences should go into $XDG_CONFIG_HOME (which default to ~/.config)
and cached data should go to $XDG_CACHE_HOME (which default to ~/.cache).
More details at :

Full specification can be found at: 

The Freedesktop.org XDG base directory specification have good de facto adoption.
It has been adopted by:
- GNOME ( https://live.gnome.org/GnomeGoals/XDGConfigFolders )
- GTK+ ( https://bugzilla.gnome.org/show_bug.cgi?id=646631 )
- KDE ( http://techbase.kde.org/KDE_System_Administration/XDG_Filesystem_Hierarchy#Freedesktop.org_and_Standard_Directories )
- QT ( http://harmattan-dev.nokia.com/docs/library/html/qt4/qsettings.html#setPath )
- XFCE ( http://docs.xfce.org/xfce/xfce4-session/advanced in Files and Environment Variables )
- Razor-qt
- VLC ( https://trac.videolan.org/vlc/ticket/1267 )
- GStreamer ( https://bugzilla.gnome.org/show_bug.cgi?id=518597 )
- Chrome ( http://code.google.com/p/chromium/issues/detail?id=16976 )
- many more upstream applications
- Ubuntu ( http://brainstorm.ubuntu.com/idea/6557/ & http://packages.ubuntu.com/fr/source/precise/libxdg-basedir )
- Debian ( http://packages.debian.org/squeeze/libxdg-basedir1 )
- Red Hat
- Fedora
- Suse
- many more distributions

I think that systemtap should use same locations than the vast majority of Desktop environment and applications.

There are real advantages of following this specification :
- a lot less cluttered $HOME
- Make backups a lot more safer and easier.
  Backuping your $XDG_DATA_HOME along with your files is enough 
  (or just excluding $XDG_CACHE_HOME)
- A lot easier to reset a default configuration if you want/need it (and 
  without any risk to loose informations). Even for the software itself 
  could choose to reset $XDG_CONFIG_HOME if needed.
- Avoid some strange bugs that happens because you had a old version of 
  some configuration file
- A lot more of flexibility and portability because no path are hardcoded.