Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nefigtut
Copy link

@nefigtut nefigtut commented Jan 11, 2023

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.

@github-actions
Copy link

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.

Copy link
Contributor

@Soapux Soapux left a 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.

@nefigtut
Copy link
Author

nefigtut commented Apr 1, 2023

no one from lightdm maintainers/devs has ever reacted to this pr or to #95.
while your suggestion is reasonable, i don't see any sense investing efforts into updating this pr knowing it will be ignored anyway. i give up and version-lock hacked lightdm on my systems.

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);

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.

Copy link

@rozhuk-im rozhuk-im left a 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

@rozhuk-im
Copy link

I am not sure that this work: XDG_* - who set these vars?

@madpilot78
Copy link
Contributor

I am not sure that this work: XDG_* - who set these vars?

@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 /usr/local/etc/xdg

So my guess is that depending on how they are setup these variable could not be correctly populated when the code actually executes.

@nefigtut
Copy link
Author

#335 is a nicer version of this indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants