-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make location of .xsession-errors configurable #287
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XDG_CACHE_HOME
should be here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-paste fix required
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. |
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.