- Package:
- x11-common
- Source:
- xorg
- Submitter:
- Tim Connors
- Date:
- 2010-10-02 12:00:06 UTC
- Severity:
- wishlist
Is there any reason why /etc/X11/Xsession appends to the logfile instead of creating it: exec >>"$ERRFILE" 2>&1 If the argument is that you want to be able to see what errors happened in the last session, so you don't want to clear them out before the user gets to review them, they can always log into the console and review the errors before they restart X. Meanwhile, the non-priveleged user has no opportunity to make sure their .xsession-errors file is emptied when their session starts, because if they empty it unconditionally in their own ~/.xsession file, then they'll lose any error message output before ~/.xsession executes. This is particularly insidious when the disk is full because something was writing lots of crap to ~/.xsession-errors. That crap is not cleared out when the user's session restarts, and so that user can't log in because their Xauthority file can't be modified, should they opt for Xauthority to be created in their home directory (or their desktop manager will get stuck when it tries to read-write-modify its dotfiles). All of this talk for the past 5 years that maybe we should have a mechanism for limiting the size of logfiles is just skirting around the issue. The logfile never shrinks if it is never truncated at X startup! Fix that one line, and the whole issue goes away! Disk full because of too much crap emitted to ~/.xsession-errors? Well, just let the unsophisticated user log out and log back in again.
[I'm not a maintainer, just happened be following X bugs...] Tim Connors <reportbug@rather.puzzling.org> writes: Always might be too strong word. On my PDA I don't have a physical keyboard, the only way to read .xsession-errors is via X or by connecting a laptop. And on my laptop switching virtual consoles sometimes fails if I have used suspend... I think this is the real problem and applications should be fixed to limit their error output. How about a compromise? Could we truncate all but the last 1000 lines in /etc/X11/Xsession?
Yep. But sometimes wmbattery goes haywire trying to connect to HAL, or a homegrown app might output too much. In the absense of a library to do this (and I *really* hate it when gnome by default limits output and just discards the rest - its limit is arbitrarily small, and I have no way of retrieving that lost information after a certain point in a desktop session once it starts discarding data. Fortunately, I do not use gnome often). Sure. Or perhaps 1000*80 characters (never encountered super long lines as output to .xsession-errors, but could happen).
package x11-common tag 596634 patch thanks Tim Connors <reportbug@rather.puzzling.org> writes: Can you locate where this limit is in gnome? Is it a per-app limit or global to all gnome applications? Good point. I recall seeing binaries in ~/.xsession-errors. The attached patch keeps only the last 512 KiB of ~/.xsession-errors on login. Can you test if this works for you?
It used to be in gdm, was removed in 2.20.11-2. That seems to duplicate the last 512kB rather than remove the rest? Perhaps your '>>' ought to be '>'? Cheers, Julien
Julien Cristau <jcristau@debian.org> writes: Whoops, yes indeed. I had some debugging prints like "starting session on $(date)" there and forgot >>. Fixed version is attached.
Seems to work thanks.