?
Solved

change systemwide stderr

Posted on 2003-03-18
3
Medium Priority
?
493 Views
Last Modified: 2008-02-26
Hello.

I have a question regarding the systemwide stderr. I have an embedded x386 System with linux, without any vga port. The console is set to ttyS1. In order not to see any error messages I would like to change the stderr one time during system start to /dev/null. Then, all later started processes shall use the new stderr as output.
Do anyone have an idea how to do this? (shell script or C/C++-Code)?

Thank you very much.

R.Stader
0
Comment
Question by:roline
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
sppalser earned 100 total points
ID: 8159785
Not sure why you really want to shut this off as the unix stderr is the facility that potentially lets you know why a command failed and is quite useful in the writing of shell scripts where you want to test for a non-zero result code.  I don't believe that you really want to alter this.  If you talking about system wide error messages like a disk error, general IO error, getty messages, etc. that may pop up on the system console screen there should be a way to stop those from coming up on the system console.  

I don't have a real definitive answer here as all the unices vary slghtly but hopefully we can get you pointed in the right direction.

You may want to do some research on the /dev/error device.  There should be some man pages addressing this.  In unix there is also the syslogd daemon that runs and is the "redirector" for systemwide errors and this utilizes the /dev/error device.  You should also investigate how to modify the syslogd daemon's /etc/syslog.conf file to make the error handler do what you want.

To go further on the subject:  If you don't want any error messages to come up through normal command execution then you may need to write some shell scripts with the commands you want embedded in the scripts where you would redirect the stderr to the bitbucket:

     # command -options 2>/dev/null

Hope that helps point you in the right direction.

Good Luck
0
 

Assisted Solution

by:dlinvill
dlinvill earned 100 total points
ID: 8159854
I think stderr is a shell concept not a system wide thing.  I know under bash you can redirect stderr with "exec 2> /dev/null"  

0
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9259111
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is to:

Points split between sppalser and dlinvill

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Paul
EE Cleanup Volunteer
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally Windows/Microsoft Updates will fail to update. We have found a code that will delete all temporary files and re-register all dll's related to Windows/Microsoft Updates! This works 99% of the time to get the updates working again! The…
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question