change systemwide stderr


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.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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"  

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.


EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.