8.10. The Quota System for Hard Drive Space

8.10.1. Stopping the File .xsession-error From Filling up Your Entire Hard Drive

Sometimes a program can get very troublesome and start writing enormous amount of error messages to the file .xsession-errors in a user's home directory. Some programs, especially GIMP, are fully capable in the space of only a few minutes of creating such a large .xsession-erros file that the whole hard drive gets full. So, everything stops working. Then the root user has to go in to the main server and find that file and delete it. This is not exactly what you want to do on a regular schoolday.

So, even if such error message files as .xessions-errors are surely useful to have when you need to diagnose a problem, they are really more of a hassle in the schoolday. So, you need to get rid of it. You can do this by redirecting all messages that would otherwise be written to this file, right into the waste bin /dev/null.

By changing a few lines in the file /etc/X11/Xsession, set a comment symbol(#) in front of these lines, in this way:


#ERRFILE=$HOME/.xsession-errors
#
## attempt to create an error file; abort if we cannot
#if touch $ERRFILE 2> /dev/null && [ -w $ERRFILE ]; then
#  chmod 600 "$ERRFILE"
#elif ERRFILE=$(tempfile 2> /dev/null); then
#  if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
#    message "Xsession: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
#             "\"$ERRFILE\"."
#  fi
#else
#  errormsg "Xsession: unable to create X session log/error file.  Aborting."
#fi
#
#exec > "$ERRFILE" 2>&1
And set in these two lines instead:

errfile="/dev/null"
exec > "$errfile" 2>&1
Now you don't need to be afraid that .xsession-errors will fill up your entire hard drive.