Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
On Mon, 13 Sep 2010, Timo Juhani Lindfors wrote: > Julien Cristau writes: > > That seems to duplicate the last 512kB rather than remove the rest? > > Perhaps your '>>' ought to be '>'? > > Whoops, yes indeed. I had some debugging prints like "starting session > on $(date)" there and forgot >>. > > Fixed version is attached. Seems to work thanks. -- TimC The stereotypical Islay is like chewing on a well-preserved rowing boat, spiced up with seaweed, whereas the 20yo Laddie is more like relishing a gourmet meal in said rowing boat. -- Ingvar in ASR -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/alpine.deb.2.00.1010022155420.15...@dirac.rather.puzzling.org
Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
Julien Cristau writes: > That seems to duplicate the last 512kB rather than remove the rest? > Perhaps your '>>' ought to be '>'? Whoops, yes indeed. I had some debugging prints like "starting session on $(date)" there and forgot >>. Fixed version is attached. >From d1df83712f29dc7ffe2203f38efdd290fbac6535 Mon Sep 17 00:00:00 2001 From: Timo Juhani Lindfors Date: Mon, 13 Sep 2010 14:25:54 +0300 Subject: [PATCH] Keep only last 512 KiB of .xsession-errors --- debian/x11-common/etc/X11/Xsession |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/debian/x11-common/etc/X11/Xsession b/debian/x11-common/etc/X11/Xsession index 6ad7d6e..6145389 100755 --- a/debian/x11-common/etc/X11/Xsession +++ b/debian/x11-common/etc/X11/Xsession @@ -74,6 +74,13 @@ else errormsg "unable to create X session log/error file; aborting." fi +if ERRFILETMP=$(tempfile 2> /dev/null); then +# Keep only last 512 KiB of $ERRFILE +tail --bytes 524288 "$ERRFILE" > "$ERRFILETMP" +cat "$ERRFILETMP" > "$ERRFILE" +rm -f "$ERRFILETMP" +fi + exec >>"$ERRFILE" 2>&1 echo "$PROGNAME: X session started for $LOGNAME at $(date)" -- 1.7.1
Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
On Mon, Sep 13, 2010 at 14:28:37 +0300, Timo Juhani Lindfors wrote: > Tim Connors writes: > > this (and I *really* hate it when gnome by default limits output and just > > Can you locate where this limit is in gnome? Is it a per-app limit or > global to all gnome applications? > It used to be in gdm, was removed in 2.20.11-2. > >> How about a compromise? Could we truncate all but the last 1000 lines > >> in /etc/X11/Xsession? > > > > Sure. Or perhaps 1000*80 characters (never encountered super long lines > > as output to .xsession-errors, but could happen). > > 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? > > >From 5433fac367d3c14fedfc542b0710cc1399683ac4 Mon Sep 17 00:00:00 2001 > From: Timo Juhani Lindfors > Date: Mon, 13 Sep 2010 14:25:54 +0300 > Subject: [PATCH] Keep only last 512 KiB of .xsession-errors > > --- > debian/x11-common/etc/X11/Xsession |7 +++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/debian/x11-common/etc/X11/Xsession > b/debian/x11-common/etc/X11/Xsession > index 6ad7d6e..6937e8f 100755 > --- a/debian/x11-common/etc/X11/Xsession > +++ b/debian/x11-common/etc/X11/Xsession > @@ -74,6 +74,13 @@ else >errormsg "unable to create X session log/error file; aborting." > fi > > +if ERRFILETMP=$(tempfile 2> /dev/null); then > +# Keep only last 512 KiB of $ERRFILE > +tail --bytes 524288 "$ERRFILE" > "$ERRFILETMP" > +cat "$ERRFILETMP" >> "$ERRFILE" > +rm -f "$ERRFILETMP" > +fi > + That seems to duplicate the last 512kB rather than remove the rest? Perhaps your '>>' ought to be '>'? > exec >>"$ERRFILE" 2>&1 > > echo "$PROGNAME: X session started for $LOGNAME at $(date)" Cheers, Julien signature.asc Description: Digital signature
Processed: Re: Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
Processing commands for cont...@bugs.debian.org: > package x11-common Limiting to bugs with field 'package' containing at least one of 'x11-common' Limit currently set to 'package':'x11-common' > tag 596634 patch Bug #596634 [x11-common] x11-common: /etc/X11/Xsession always appends to .xsession-errors Bug #276545 [x11-common] xfree86-common: add Xsession option and logic for controlling number of lines in $HOME/.xsession-errors Bug #287876 [x11-common] xfree86-common: Xsession does nothing to prevent $HOME/.xsession-errors from growing very large Bug #351166 [x11-common] size of .xsession-errors should be limited Ignoring request to alter tags of bug #596634 to the same tags previously set Ignoring request to alter tags of bug #276545 to the same tags previously set Ignoring request to alter tags of bug #287876 to the same tags previously set Ignoring request to alter tags of bug #351166 to the same tags previously set > thanks Stopping processing here. Please contact me if you need assistance. -- 596634: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596634 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/handler.s.c.128437732323752.transcr...@bugs.debian.org
Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
package x11-common tag 596634 patch thanks Tim Connors writes: > this (and I *really* hate it when gnome by default limits output and just Can you locate where this limit is in gnome? Is it a per-app limit or global to all gnome applications? >> How about a compromise? Could we truncate all but the last 1000 lines >> in /etc/X11/Xsession? > > Sure. Or perhaps 1000*80 characters (never encountered super long lines > as output to .xsession-errors, but could happen). 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? >From 5433fac367d3c14fedfc542b0710cc1399683ac4 Mon Sep 17 00:00:00 2001 From: Timo Juhani Lindfors Date: Mon, 13 Sep 2010 14:25:54 +0300 Subject: [PATCH] Keep only last 512 KiB of .xsession-errors --- debian/x11-common/etc/X11/Xsession |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/debian/x11-common/etc/X11/Xsession b/debian/x11-common/etc/X11/Xsession index 6ad7d6e..6937e8f 100755 --- a/debian/x11-common/etc/X11/Xsession +++ b/debian/x11-common/etc/X11/Xsession @@ -74,6 +74,13 @@ else errormsg "unable to create X session log/error file; aborting." fi +if ERRFILETMP=$(tempfile 2> /dev/null); then +# Keep only last 512 KiB of $ERRFILE +tail --bytes 524288 "$ERRFILE" > "$ERRFILETMP" +cat "$ERRFILETMP" >> "$ERRFILE" +rm -f "$ERRFILETMP" +fi + exec >>"$ERRFILE" 2>&1 echo "$PROGNAME: X session started for $LOGNAME at $(date)" -- 1.7.1
Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
On Mon, 13 Sep 2010, Timo Juhani Lindfors wrote: > [I'm not a maintainer, just happened be following X bugs...] > > Tim Connors writes: > > before the user gets to review them, they can always log into the > > console and review the errors before they restart X. > > 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... > > > This is particularly insidious when the disk is full because something > > was writing lots of crap to ~/.xsession-errors. That crap is not > > I think this is the real problem and applications should be fixed to > limit their error output. 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). > > because of too much crap emitted to ~/.xsession-errors? Well, just > > let the unsophisticated user log out and log back in again. > > How about a compromise? Could we truncate all but the last 1000 lines > in /etc/X11/Xsession? Sure. Or perhaps 1000*80 characters (never encountered super long lines as output to .xsession-errors, but could happen). -- TimC Anyone who quotes me in their sig is an idiot. -- Rusty Russell. -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/alpine.deb.2.00.1009131745300.2...@dirac.rather.puzzling.org
Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
[I'm not a maintainer, just happened be following X bugs...] Tim Connors writes: > before the user gets to review them, they can always log into the > console and review the errors before they restart X. 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... > This is particularly insidious when the disk is full because something > was writing lots of crap to ~/.xsession-errors. That crap is not I think this is the real problem and applications should be fixed to limit their error output. > because of too much crap emitted to ~/.xsession-errors? Well, just > let the unsophisticated user log out and log back in again. How about a compromise? Could we truncate all but the last 1000 lines in /etc/X11/Xsession? -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/84pqwi9spm@sauna.l.org
Bug#596634: x11-common: /etc/X11/Xsession always appends to .xsession-errors
Package: x11-common Version: 1:7.5+6 Severity: important 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. -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (500, 'testing'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores) Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages x11-common depends on: ii debconf [debconf-2.0] 1.5.35 Debian configuration management sy ii debianutils 3.4Miscellaneous utilities specific t ii lsb-base 3.2-23.1 Linux Standard Base 3.2 init scrip x11-common recommends no packages. x11-common suggests no packages. -- debconf information: x11-common/xwrapper/actual_allowed_users: console x11-common/xwrapper/allowed_users: Console Users Only -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100912234149.7647.56167.report...@aatpc2.aao.gov.au