Mounting .xsession-errors in tmp

Questions specific to the Xfce DE go here
bin
Posts: 47
Joined: 13 Dec 2013 15:31

Mounting .xsession-errors in tmp

Postby bin » 10 Jun 2020 09:15

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?

User avatar
ilu
Posts: 2712
Joined: 09 Oct 2013 12:45

Re: Mounting .xsession-errors in tmp

Postby ilu » 11 Jun 2020 11:12

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.

User avatar
Arjen Balfoort
Site Admin
Posts: 9501
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Mounting .xsession-errors in tmp

Postby Arjen Balfoort » 11 Jun 2020 12:25

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


SolydXK needs you!
Development | Testing | Translations

bin
Posts: 47
Joined: 13 Dec 2013 15:31

Re: Mounting .xsession-errors in tmp

Postby bin » 12 Jun 2020 13:32

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.

User avatar
ilu
Posts: 2712
Joined: 09 Oct 2013 12:45

Re: Mounting .xsession-errors in tmp

Postby ilu » 12 Jun 2020 15:35

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.

User avatar
bas_otten
Posts: 216
Joined: 19 Oct 2013 12:22
Location: Netherlands

Re: Mounting .xsession-errors in tmp

Postby bas_otten » 21 Jun 2020 09:59

@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

bin
Posts: 47
Joined: 13 Dec 2013 15:31

Re: Mounting .xsession-errors in tmp

Postby bin » 21 Jun 2020 11:16

@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!

User avatar
ilu
Posts: 2712
Joined: 09 Oct 2013 12:45

Re: Mounting .xsession-errors in tmp

Postby ilu » 22 Jun 2020 11:49

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.

User avatar
bas_otten
Posts: 216
Joined: 19 Oct 2013 12:22
Location: Netherlands

Re: Mounting .xsession-errors in tmp

Postby bas_otten » 27 Jun 2020 08:28

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.


Return to “Xfce specific (SolydX)”

Who is online

Users browsing this forum: No registered users and 0 guests