Lørdag 31 mai 2008 09:39, skrev Petter Reinholdtsen: > One issue that come up from time to time, is that verbose programs > like The Gimp is filling up ~/.xsession-errors with garbage, and > leading to full disks in the worst case, or filling a users disk > quote in the slightly less bad case. > > One proposal to solve this is to edit /etc/X11/Xsession to not create > the file. A problem with this approach is that it give upgrade > problems when a new version of the file is provided in an upgraded > package. It also make it impossible to get the xsession errors when > needed. > > I gave the problem some thought this morning, and a better idea seem > to me to provide a Xsession.d fragment to do this instead. By adding > /etc/Xsession.d/05debian-edu-noerrfile with content like this > > # This is a -*- shell-script -*- fragment called by > /etc/X11/Xsession > > # Redirect all errors to /dev/null instead of $ERRFILE > # (~/.xsession-errors by default), to avoid filling up users home > # directory with error messages. Allow the user to disable this by > # creating ~/.xsession-errors-enable > if [ ! -f "$HOME/.xsession-errors-enable" ] ; then > # Report the change to the log file before switching > echo "info: Redirecting xsession messages to /dev/null." > echo "info: touch '$HOME/.xsession-errors-enable' to disable > this." exec >> /dev/null 2>&1 > fi > > It should have a low number to keep the content in ~/.xsession-errors > short. > > Do others believe this is a good idea to include by default in Debian > Edu (debian-edu-config, I guess)? Or perhaps it should go into > x11-common instead, with a mechanism to enable or disable this for > all users at install time? > > Happy hacking, > -- > Petter Reinholdtsen Please enable it by default, I've seen backup and home0 filled with 1-15GB big .xsession-errors files, it's such a nuisance that I wrote up a way to disable it years ago in http://www.skolelinux.no/~klaus/sarge/newdriftbok.sarge.en.html#AEN3310 Also one should exclude them from backup. Typical programs that gladly create huge .xsession-errors are gimp, gcompris, googleearth, picassa, wine ++. I see a lot of alsa errors, probably when an application thinks there is a soundcard available. When the problem arise, you only have time to find the user with this file, fast, and delete the file, fast, there is seldom any time left to dig into the real problem, so most .xsession-errors are never looked into. For fun, here is the summary with top 10 from a server with only 57 users: tjener:/skole/tjener/home0# find . -name ".xsession-errors" -exec ls -l {} \; |awk '{print $5}'|sort -n|tail -n 10 78956686 111730082 133888993 157296808 170802117 180430975 206783434 211409781 324558487 391653687 All included these 57 users have a total of 2312M with .xsession-errors, with a copy in the backup .... Did I say that I consider .xsession-errors evil? -- Klaus Ade 67E61D18B2C44F8A3DA35C6D849F9F5F 26FA477D
Attachment:
pgp2OIkItII0P.pgp
Description: PGP signature