Page 1 of 1

Mounting .xsession-errors in tmp

Posted: 10 Jun 2020 09:15
by bin
On other Debian based distros I have no problem mounting my .xession-errors in /tmp - which is itself mounted in tmpfs via fstab

Normally I just edit the ERRFILE value in /etc/Xsession and it works quite happily. This is primarily to avoid loads of activity on the SSD.

For some reason I have not been able to get this to work in SolydX 10 and I'm puzzled as to why...I guess something is being overwritten at login but cannot see what.

Any ideas please?

Re: Mounting .xsession-errors in tmp

Posted: 11 Jun 2020 11:12
by ilu
I used to move it successfully into /var/log in exactly the way you did in SolydXK9. I could not get that to work in SolydXK10 either. I remember I tried for hours but I don't remember details anymore. I'm positive that we did not change anything relevant in between SolydXK9 and SolydXK10. It just stopped working. I'm surprised to hear that it works on other distros, xsession-errors is a beast which people all over the internet fail to tame.

After a long try-and-error process Arjen and I found a way to at least stop xsession-errors to flood the home (or even root) partition by taming its expansion via a script. But that script does not reset the location, it just ensures that the size stays reasonable even if shit hits the fan. The discussion is here viewtopic.php?f=79&t=7390. Have a look at the script in /usr/bin/xsession-logcontrol. That's all SolydXK does about xsession-errors.

That being said, I would not worry too much about ssd wear, afaik manufacturers got that problem under control, and ssds got really cheap to replace. I still need xsession-errors for debugging from time to time, so putting it into /tmp is not a solution I would advocate. Most important is to prevent that file from flooding everything and I think we got that covered. But if you happen to find out why moving it doesn't work anymore I would be interested.

Re: Mounting .xsession-errors in tmp

Posted: 11 Jun 2020 12:25
by Arjen Balfoort
xsession-logcontrol is part of the solydxk-system (since version 3.0.9, 07 Oct 2018) package: /usr/bin/xsession-logcontrol

The desktop file is installed through skel for new users: /etc/skel/.config/autostart/xsession-logcontrol.desktop

Re: Mounting .xsession-errors in tmp

Posted: 12 Jun 2020 13:32
by bin
OK - thank you both for the useful pointers.

I think what is happening is that the setting in Xsession is being read, but it is then overwritten by logcontrol.

Oh well - no matter.

Re: Mounting .xsession-errors in tmp

Posted: 12 Jun 2020 15:35
by ilu
No, I'm sure it's not overwritten. The variable "LOG" is used inside the script only and has nothing to do with the variable ERRFILE. I tested with and without the script.

Re: Mounting .xsession-errors in tmp

Posted: 21 Jun 2020 09:59
by bas_otten
@bin,
Reading your OP, you might want to check this post: viewtopic.php?f=6&t=5536&p=54827&hilit= ... ors#p54827.
Some time ago I worked out a solution for my setup to bring .xsession-errors to tmpfs. Be it for SolydK (autostart), it should be easily transferrable to X.
Regards, Bas

Re: Mounting .xsession-errors in tmp

Posted: 21 Jun 2020 11:16
by bin
@Bas

Cheers Bas - I do recall from a brief foray into the land of Plasma that the .xession-errors just goes bonkers!

I have been able to hunt down most of the issues that hit it in XFCE and it is now down to a happy 3 - 6 k.

The other pain is .xfce4-session.verbose-log which has so far failed to yield to symlinks etc. It's something to do with the the file being renamed and the timing. I will be trying something with a script called from .rc-local with a 5 second wait so that I can manipulate the files after the login process has done its thing.

It's something to do!

Re: Mounting .xsession-errors in tmp

Posted: 22 Jun 2020 11:49
by ilu
You should not need to do anything to tame .xsession-errors because the script I mentioned does that for you. The file will not get out of control even if it is flooded with error messages by a program that goes bonkers. If you move. xsession-errors to another location you just need to change the script so it finds the file.

The issue was that bin (and also I) could not move the file by editing /etc/X11/Xsession - did that work out now? Does your setup still work bas_otten?

Just a warning though: /tmp might be mounted as a ramdisk (check for tmpfs entries in fstab). If you move .xsession-errors there and it gets flooded you can run out of RAM very quickly resulting in a total hangup. I've seen .xsession-errors growing by 1gb per hour. swap might help but that will definitely not improve performance. You have been warned.
The other pain is .xfce4-session.verbose-log which has so far failed to yield to symlinks etc. It's something to do with the the file being renamed and the timing.
No it's not. The problem is that you can neither move nor rename nor symlink an open file. And log files like .xsession-errors are never closed as long as the session is running. The system will continue to write to the inode it remembers no matter how you manipulate its directory entry. Worst case is that you end up with a massive inode not represented in the file system.

Whatever you do, you need to take into consideration what the command you use does internally on inode level. Most commands don't really manipulate the inode but the directory entry instead. We found that only truncate works.

Re: Mounting .xsession-errors in tmp

Posted: 27 Jun 2020 08:28
by bas_otten
ilu wrote: The issue was that bin (and also I) could not move the file by editing /etc/X11/Xsession - did that work out now? Does your setup still work bas_otten?
Sorry for the delay: yes, this still works on my (current SolydK) system.