Make location of .xsession-errors configurable#287
Make location of .xsession-errors configurable#287nefigtut wants to merge 1 commit intoubuntu:mainfrom
Conversation
|
Hey! nefigtut has not signed the Canonical CLA which is required to get this contribution merged on this project.
Please head over to https://ubuntu.com/legal/contributors to read more about it. |
There was a problem hiding this comment.
I think it should be XDG_STATE_HOME or ~/.local/state if not found, which was designed for such log files. I would also remove the dot from the file since it will already be in a dot folder. Personally, I think it should probably go in it's own x11 sub directory too since more than one file is created. So ~/.local/state/x11/xsession-errors in that case. Lastly we should probably check if the directories exist and if not, create them with mode 700 to follow the spec.
|
no one from lightdm maintainers/devs has ever reacted to this pr or to #95. |
| priv->log_filename = g_build_filename (g_getenv ("XDG_STATE_HOME"), ".xsession-errors", NULL); | ||
| else | ||
| if (g_getenv ("XDG_CACHE_HOME")) | ||
| priv->log_filename = g_build_filename (g_getenv ("XDG_STATE_HOME"), ".xsession-errors", NULL); |
|
I am not sure that this work: |
@rozhuk-im It really depends. As far as I understand in most Linux distributions it is systemd setting them nowadays. But these can also be populated by PAM modules or session startup scripts. In FreeBSD it looks like the magic resides in So my guess is that depending on how they are setup these variable could not be correctly populated when the code actually executes. |
|
#335 is a nicer version of this indeed. |
ahmubashshir
left a comment
There was a problem hiding this comment.
IMO, if the log files are in $XDG_CACHE_HOME or $XDG_STATE_HOME, . doesn't need to be in the filename.
LightDM always uses $HOME/.xsession-errors as the log file because it is harcoded. There are several possible reasons for someone to define another location, for example to write it into the RAM or to just have a tidier $HOME-folder.
This is a long-awaited feature, see: #95 and https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1001035
Unfortunately, I have no idea how to fix tests to conform this change. Please, feel free to update as needed.