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 #95

Open
dorsiflexion opened this issue Oct 15, 2019 · 16 comments
Open

Make location of .xsession-errors configurable #95

dorsiflexion opened this issue Oct 15, 2019 · 16 comments

Comments

@dorsiflexion
Copy link

dorsiflexion commented Oct 15, 2019

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.

$HOME just isn't the right place for the file. $XDG_RUNTIME_DIR (that's /run/user/$UID with systemd) or $XDG_CACHE_HOME (= $HOME/.cache) $XDG_STATE_HOME, which defaults to $HOME/.local/state is much more suitable.

Currently there is no way around this one path. So please make it configurable. I could live with a hardcoded path, too, if it was the aforementioned plus an xorg subfolder.

Edit 2023-06-06: Updated to $XDG_STATE_HOME.

@hosxy
Copy link

hosxy commented Dec 28, 2019

I think so.
.xsession-errors in $HOME is not a good idea, I think it will be more suitable where it is in $XDG_CACHE_HOME or $XDG_RUNTIME_DIR

@nefigtut
Copy link

+1 to this, it would be great to have a configurable location for .xsession-errors.
i ended up binary hacking /usr/sbin/lightdm to change the hardcoded name to the ".cache/xs-errors".

funny enough, this issue dates back to 2012 (if not earlier):
https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1001035

@Alexander-Shukaev
Copy link

This is a simple, but useful change. Uncontrollable growth of .xsession-errors in $HOME and, in general, its presence there drive people nuts all over the web. Please, fix this in the upcoming release.

@haarp
Copy link

haarp commented Jun 30, 2020

Quick'n'dirty hack:

--- a/src/session.c     2018-08-30 02:28:55.000000000 +0200
+++ b/src/session.c     2020-01-08 14:57:16.495681494 +0100
@@ -981,7 +981,7 @@
 {
     SessionPrivate *priv = session_get_instance_private (session);

-    priv->log_filename = g_strdup (".xsession-errors");
+    priv->log_filename = g_strdup (".cache/xsession-errors");
     priv->log_mode = LOG_MODE_BACKUP_AND_TRUNCATE;
     priv->to_child_input = -1;
     priv->from_child_output = -1;

doesn't follow $XDG_CACHE_HOME but works for me.

@azureblue
Copy link

azureblue commented Oct 27, 2020

There's even dirtier hack that doesn't require recompilling or anything... you can just edit /usr/sbin/lightdm in ghex (or any binary editor) and find the null ended string '.xsession-errors', and replace it.

Very important: you shouldn't change the the size of the string but you can put a dirname (with /) there..

@Alexander-Shukaev
Copy link

There's even dirtier hack that doesn't require recompilling or anything... you can just edit /usr/sbin/lightdm in ghex (or any binary editor) and find the null ended string '.xsession-errors', and replace it.

Very important: you shouldn't change the the size of the string but you can put a dirname (with /) there..

Just discussed today with colleagues, this pandemic drastically changed everyone. You seem to have become very bold, Sir. :)

@azureblue
Copy link

azureblue commented Oct 27, 2020

It was just obsessive for me to fix it today and apt build-dep lightdm wanted too many staff so that's what I did... ;)

btw. I remember modifying mbr using ghex and dd to resize root partition without unmounting so... ;P

@tricktux
Copy link

tricktux commented Apr 6, 2021

Any updates on this simple but useful change?

@kuator
Copy link

kuator commented May 27, 2022

Friendly bump

@kuator
Copy link

kuator commented May 27, 2022

Here's a small script I compiled from the above answers. Ubuntu 22.04

if strings /usr/sbin/lightdm | grep -q '.xsession-errors' ; then
  sudo apt install bbe
  bbe -e 's/.xsession-errors/.cache\x2Fxs-errors/' /usr/sbin/lightdm > outfile
  chmod +x outfile
  sudo mv /usr/sbin/lightdm /usr/sbin/lightdm-back
  sudo mv outfile /usr/sbin/lightdm
fi

@devnoot
Copy link

devnoot commented Oct 6, 2022

Another friendly bump. Having the .xsession-errors file in $HOME doesn't make a lot of sense to me.

@Manix80
Copy link

Manix80 commented Oct 11, 2022

Wouldn't there be some crazy coder to add this useful feature?
Strange that no one is looking into it, complicated to implement maybe.

@hildebro
Copy link

hildebro commented Jan 1, 2023

another bump

@HerroBert
Copy link

bumpy ride...

@lockie
Copy link

lockie commented May 5, 2023

@robert-ancell would you please kindly have a look at #287 or provide a reason why this change is unwelcome?

@datsudo
Copy link

datsudo commented Oct 3, 2024

bump

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

No branches or pull requests