Guest joehill Posted February 13, 2003 Report Share Posted February 13, 2003 I would like to show the output from tty1 while in x so that I can troubleshoot x apps. I understand the tool for this is "tail" and i have figured out how to monitor /var/log/messages, but I don't know how to do it for the terminal output. I'm thinking that I could maybe have the tty output directed to a text file and then have tail monitor that text file, but how to do that? Quote Link to comment Share on other sites More sharing options...
aru Posted February 13, 2003 Report Share Posted February 13, 2003 I asume that you start the X server from runlevel 3 (text mode). The easiest way will be: user@host ~$ startx &> Xoutput That will redirect stdout and stderr to Xoutput file, which you can monitor while in X using: user@host ~$ tail -f Xoutput One step ahead will be to redirect stdout to a file and stderr to another file: user@host ~$ (exec > X_std_output; exec 2> X_std_error; startx ) & where X_std_output will archive stdout messages, and X_std_error will keep the error ones. Also, notice that that command will create a subshell in the background form where startx is launched, since the redirections only affect that subshell, you'll have your TTY intact and ready for running whatever you want. There are many other ways to do it (for example duplicating the file descriptors). HTH Quote Link to comment Share on other sites More sharing options...
Guest joehill Posted February 13, 2003 Report Share Posted February 13, 2003 many thanks! I am embarassed it's so simple, but not surprised I missed it, know what I mean? now let me figure out how to keep the output file from filling my harddrive... :roll: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.