Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 02-26-2013, 04:57 PM   #1
LQ Newbie
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
Redirecting user space console messages


I'm working on a third party provided embedded hardware(mips). It has a preloaded linux kernel and CFE boot loader.
My program needs to collect the console/stdout messages from all the running programs and send to a server. (Somewhat similar to netconsole - but netconsole collects only kernel messages.)
Linux bootup options "console=<device>" will help us to add one more console device. But I don't have flexibility to change CFE or rebuild kernel with my own driver.
Fortunately, this linux build supports loadable modules. Can I redirect the console output to a loadable module? If so, what are the steps to do it?
(My idea is to create a tty-console like device, which loops back the messages to userspace.)

PS: Pls let me know, if the system-wide "stdout" redirection is possible by a user land process - that is my first preference.

Thanks in advance.
Old 03-05-2013, 12:29 AM   #2
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 184

Rep: Reputation: 48
If your system has the syslogd daemon running then you might look at that:

$man 8 syslogd

User programs can write to the system log files by using the logger command from a script:

$man 1 logger

or from calling the syslog function from a program:

$man 3 syslog


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
user space prints/console output stealth53 Linux - Kernel 2 04-02-2012 02:54 AM
redirecting log messages to /dev/console mlalitha Linux - Newbie 0 01-19-2009 06:09 AM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 07:39 PM
redirecting cron messages jomy General 1 12-29-2004 03:35 AM
Redirecting console boot messages to different tty. cenkozkan Linux - Software 2 01-17-2004 05:11 AM

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

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