LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-20-2008, 09:30 PM   #1
JackieBrown
Member
 
Registered: Dec 2004
Location: San Antonio, TX
Distribution: Debian-AMD64 Sid
Posts: 481

Rep: Reputation: 31
Redirect output of .Xsession


How would I re-direct the out of this to /dev/null or have it not record at all?

Would a softlink work? I can't do a hardlink since they are on different partitions.
 
Old 07-20-2008, 10:18 PM   #2
JackieBrown
Member
 
Registered: Dec 2004
Location: San Antonio, TX
Distribution: Debian-AMD64 Sid
Posts: 481

Original Poster
Rep: Reputation: 31
Well, I fixed the root problem (it was a kde 4 issue) but am still interested if anyone has an answer.

(That file would grow about 20 gig an hour.)
 
Old 07-21-2008, 08:26 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by JackieBrown View Post
or have it not record at all?
I was once annoyed by xsession flood, I changed this line (In /etc/X11/Xsession)


# attempt to create an error file; abort if we cannot
if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
[ ! -L "$ERRFILE" ]; then
chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
"\"$ERRFILE\"; look for session log/errors in" \
"\"$TMPDIR/xsession-$USER\"."
fi
else
errormsg "unable to create X session log/error file; aborting."
fi

#remove xsession-errors
#exec >>"$ERRFILE" 2>&1
exec &> /dev/null


There are maybe cleaner ways of doing it but didn't find really.

Weeks later, I had problems with an X client and without this log, you can't really see anything, so I reverted my modification.

I don't think you can create softlinks or anything, if you look at the previous lines. It will abort if it cannot create $HOME/.xsession-errors or create a tmpfile in TMPDIR.
 
Old 07-21-2008, 08:28 AM   #4
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
Do you mean the .Xsession or the .xsession-errors file grows? Why would the non-error one grow at all?

The values of those files are defined in /etc/X11/Xsession, so theoretically, you could redirect output to /dev/null from there. Anyhow, it's this section in /etc/X11/Xsession that you would want to muck with (maybe):
Code:
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors
Never mind: I see that nx5000 has a fuller explanation of what I was (half-)thinking of.

Last edited by Telemachos; 07-21-2008 at 08:31 AM. Reason: nx5000's answer is fuller
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect the output of exec command output in perl? sudhap85 Linux - Newbie 3 08-28-2009 03:35 PM
redirect output to device christina_rules Linux - General 4 05-23-2006 02:46 AM
Redirect output jimwelc Linux - Newbie 3 05-11-2006 11:10 AM
How to redirect output to a file? mus1402 Linux - Newbie 2 02-05-2006 09:42 AM
how to redirect the output of a terminal? cpukiller Linux - Networking 5 11-10-2004 07:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration