[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#287876: xfree86-common: $HOME/.xsession-errors grows indefinitely: my fix



Package: xfree86-common
Version: 4.2.1-15.backports.org.1
Followup-For: Bug #287876

hello,

[forget Version, bug is in Sarge as well]
yessss, I looked into this bug after I was puzzled by 0 MB avail on /home
yet I knew I don't have there much stuff.

Hence I tried both of these patch/fix:

#--------------------
--- /etc/X11/Xsession   2004-09-28 14:06:49.000000000 +0200
+++ Xsession    2005-02-27 08:29:16.000000000 +0100
@@ -91,6 +91,12 @@
   errormsg "unable to create X session log/error file; aborting."
 fi
 
+find $HOME -mtime +7 -maxdepth 1 -type f -name "${ERRFILE##*/}.*" \
+  -exec rm {} \;
+[ -s "$ERRFILE" ] && \
+[ `ls -l "$ERRFILE"|tr -s  |cut -d  -f5` -gt 50000 ] && {
+  gzip -c "$ERRFILE" > "$ERRFILE.`date +%Y%m%d%H%M%S`"
+}
 exec >>"$ERRFILE" 2>&1
 
 echo "$PROGNAME: X session started for $LOGNAME at $(date)"
#--------------------

#---[/etc/logrotate.d/xsession]-----------------
/home/*/.xsession-errors {
  rotate 7
  daily
  size=500k
  compress
  copytruncate
  missingok
  notifempty
}
#-----------------------------------------------

The Xsession patch suffice as long as people open/close their X-session
regularly (eg in an office case), while the logrotate file deals with 
always-on machine/X-session (like mine ;) ) - note though it's user's home
dir wired in.
I'm keeping both. 
WFM so far.

-- oopla

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux npp 2.4.26-ss-fb-lm287 #1 Fri Jul 16 21:26:09 CEST 2004 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages xfree86-common depends on:
ii  debconf                     1.2.35       Debian configuration management sy
ii  debianutils                 1.16.2woody1 Miscellaneous utilities specific t




Reply to: