After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627939 - GDM XDG config folder implementation
GDM XDG config folder implementation
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks: 523057
 
 
Reported: 2010-08-25 12:54 UTC by Cristian KLEIN
Modified: 2013-07-25 19:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change function prototypes to make distrinction between folders clearer (3.32 KB, patch)
2010-08-25 15:29 UTC, Cristian KLEIN
reviewed Details | Review
get config_dir and cache_dir and use them (3.66 KB, patch)
2010-08-25 15:30 UTC, Cristian KLEIN
none Details | Review
Update GDM's cache from the right location (3.90 KB, patch)
2010-08-25 15:30 UTC, Cristian KLEIN
none Details | Review
GDM xdg patch(workable but not complete) (7.94 KB, patch)
2010-10-06 07:33 UTC, Jason
none Details | Review
Try to save session log to XDG cache dir (2.48 KB, patch)
2012-04-26 19:28 UTC, William Jon McCann
reviewed Details | Review
Use $XDG_CONFIG_HOME/X11 for X11 resources (2.22 KB, patch)
2012-04-26 19:28 UTC, William Jon McCann
rejected Details | Review
Try to save session log to XDG cache dir (2.59 KB, patch)
2012-04-30 18:15 UTC, William Jon McCann
committed Details | Review

Description Cristian KLEIN 2010-08-25 12:54:16 UTC
See http://live.gnome.org/GnomeGoals/XDGConfigFolders

GDM currently dumps some files in the user's home directory, which should be moved according to the XDG base directory specification:

~/.dmrc -> $XDG_CONFIG_HOME/gdm/dmrc
~/.xsession-errors -> $XDG_CACHE_HOME/gdm/xsession-errors
~/.xsession-errors.old -> $XDG_CACHE_HOME/gdm/xsession-errors.old

Will be back with a patch soonish.
Comment 1 Cristian KLEIN 2010-08-25 15:29:53 UTC
Created attachment 168745 [details] [review]
Change function prototypes to make distrinction between folders clearer
Comment 2 Cristian KLEIN 2010-08-25 15:30:17 UTC
Created attachment 168746 [details] [review]
get config_dir and cache_dir and use them
Comment 3 Cristian KLEIN 2010-08-25 15:30:59 UTC
Created attachment 168747 [details] [review]
Update GDM's cache from the right location

TO DO
- migrate files
- update documentation concerning ~/.face
Comment 4 Giovanni Campagna 2010-08-31 10:22:33 UTC
Just a random thought: aren't .xsession-errors and .dmrc supposed to be shared between gdm/xdm/kdm?

If that is the case, .dmrc should go to $XDG_CONFIG_HOME/dmrc and .xsession-errors to $XDG_CACHE_HOME/xsession-errors (or better .local/var/log/xsession-errors or /var/run/user/log/xsession-errors)
Comment 5 Cristian KLEIN 2010-08-31 10:46:26 UTC
I confirm that dmrc is shared by gdm/xdm/kdm, so comment #4 makes perfect sense. However is poses problems regarding migration. Moving .dmrc only in gdm would render GNOME incompatible with the other session managers. However, since changing the session manager is not common, would this really be a problem? Comments appreciated.
Comment 6 Sebastian 2010-08-31 16:33:05 UTC
Christan,

this is what comes to my mind right now:

Option 1: Maybe we could bring this up on the KDE/XORG/etc. mailing lists, and how the response is there, maybe we can get fixes into each wm simultaniosly?

Option 2: Move the config files and create sym links in $HOME, then after some transition time, we remove the symlinks

Cheers
Sebastian
Comment 7 Cristian KLEIN 2010-09-01 06:56:53 UTC
A common settings store is being drafted in FDo [1], but it seems to advance slowly. Too bad, it would have been the perfect replacement for dmrc. :(

[1] http://www.freedesktop.org/wiki/Specifications/config-spec
Comment 8 Jason 2010-10-03 13:13:49 UTC
i'd to see this change, too.

but .dmrc should be in $XDG_CONFIG_HOME, rename to dm.rc ro dm.conf
.xsession-errors should be in $XDG_CACHE_HOME, rename to xsession.log or something else.

.xsession-errors should not be placed in /var/log, cuz user should not have promission to change any place except there $HOME dir.

and this change don't need create symlinks, because very few users change them by editing the config file.
Comment 9 Jason 2010-10-05 18:07:12 UTC
Seems this patch is not actually work...

there will be no xsession-errors every where. and my terminals start in / .

maybe because g_get_user_config_dir cannot get user name?
Comment 10 Jason 2010-10-06 06:44:06 UTC
it won't be that easy. the earliest place user can define $XDG_CONFIG_HOME is ~/.profile or ~/.xprofile. but gdm won't read this file when save dmrc or creat .xsession-errors.

seems it's impossible to use g_get_user_config_dir() to get $XDG_CONFIG_HOME.

we can find a way to read system defined $XDG_CONFIG_HOME, and use gdm_session_worker_set_environment_variable() to store it in worker->priv->environment. use g_hash_table_lookup (worker->priv->environment, "XDG_CONFIG_HOME") to get it.
Comment 11 Jason 2010-10-06 07:33:04 UTC
Created attachment 171806 [details] [review]
GDM xdg patch(workable but not complete)

this is the patch i am using. i am afraid i can not find a way to get $XDG_CONFIG_HOME. so the gdm will use the second way:~/.config
Comment 12 Sebastian 2010-10-20 11:35:34 UTC
Review of attachment 168745 [details] [review]:

Ack
Comment 13 antistress 2011-12-09 16:06:38 UTC
Hi, 

This bug doesn't show any activity since 1 year and that's a pity to me since some work has already been done... What is the status of the proposed patch ?

Thanks
Comment 14 William Jon McCann 2012-04-26 19:28:51 UTC
Created attachment 212908 [details] [review]
Try to save session log to XDG cache dir
Comment 15 William Jon McCann 2012-04-26 19:28:58 UTC
Created attachment 212909 [details] [review]
Use $XDG_CONFIG_HOME/X11 for X11 resources
Comment 16 Ray Strode [halfline] 2012-04-26 19:52:00 UTC
Thanks everyone who looked into this and sorry for the slow response. I'll look at the latest two patches now.
Comment 17 Ray Strode [halfline] 2012-04-26 19:55:24 UTC
Review of attachment 212908 [details] [review]:

I feel like the commit message needs more rationale too it. looks mostly fine

::: daemon/gdm-session-worker.c
@@ +1897,3 @@
+
+                        if (worker->priv->is_program_session) {
+                                fd = _open_program_session_log (worker->priv->log_file);

this part doesn't depend on home_dir/cache_dir/log_dir so it should be moved out of the if (home_dir != NULL) code
Comment 18 Ray Strode [halfline] 2012-04-26 19:56:42 UTC
Review of attachment 212909 [details] [review]:

This is fine, though maybe it would be better to fall back to the old locations if the new ones don't exist.
Comment 19 Matthias Clasen 2012-04-26 22:11:56 UTC
Review of attachment 212908 [details] [review]:

It would be good if the commit message spelled out that this renames ~/.xsession-errors to ~/.cache/gdm/session.log.
.xsession-errors is one of the few dotfiles that many people know about, so we shouldn't just sweep this change under the rug.
Comment 20 Matthias Clasen 2012-04-26 22:13:18 UTC
Review of attachment 212909 [details] [review]:

I don't think this makes sense, tbh.
These files are legacy first-gen X11 things.
Better to cut them off than dragging them into a new location.
Comment 21 William Jon McCann 2012-04-30 18:15:33 UTC
Created attachment 213129 [details] [review]
Try to save session log to XDG cache dir

This moves the default location of the session log message
from ~/.xsession-errors to $XDG_CACHE_HOME/gdm/session.log
This helps avoid clobbering the log files when shared
home directories are used.
See https://live.gnome.org/GnomeGoals/XDGConfigFolders
Comment 22 William Jon McCann 2012-04-30 18:16:25 UTC
Comment on attachment 212909 [details] [review]
Use $XDG_CONFIG_HOME/X11 for X11 resources

I'll just drop this one.
Comment 23 Jeremy Bicha 2013-07-25 17:03:36 UTC
*** Bug 704879 has been marked as a duplicate of this bug. ***
Comment 24 David Biesack 2013-07-25 19:30:37 UTC
a response on 704879 notes that .xsession-errors are written to journald if available. I'm noting that here, since that file is cited above. 
$XDG_CACHE_HOME/gdm/session.log is the fallback if journald is not
available.