LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is it possible to redirect all outputs from /dev/console to /dev/pts/0? (https://www.linuxquestions.org/questions/linux-newbie-8/is-it-possible-to-redirect-all-outputs-from-dev-console-to-dev-pts-0-a-825158/)

SJDad 08-09-2010 05:12 PM

Is it possible to redirect all outputs from /dev/console to /dev/pts/0?
 
Newbie here.

The serial console is for debugging and will physically disappear when product is mature. However, there are many background processes that may print out statuses/results. These go to /dev/console or serial console.

Telnet will be the only way to get a console. I tried netconsole (with netcat) and it works, but it is only for kernel printk messages. I tried "program > /dev/pts/0" and it works also. However, it would be better if I can just change/add the console /dev/pts/0 to the existing /dev/console.

Is it possible? Thanks.

ZaSter 08-09-2010 05:48 PM

Why not use log files?
 
SJDad,

Why not redirect the program outputs to log files that have the advantage of being viewable from any terminal login?

If you are logging in using Bash, then the programs could be started up like so:

program >& /var/log/program.log

The >& captures both standard output (STDOUT) and standard error output (STDERR).

SJDad 08-09-2010 05:54 PM

Using logfile works great if the system does not crash. If the system crashes, we would like to get as much information as possible by logging user-space messages remotely as well.

ZaSter 08-09-2010 06:59 PM

Sounds like you should use syslogd. See the documentation via the command: man syslogd.


All times are GMT -5. The time now is 06:33 PM.