Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

change systemwide stderr

Posted on 2003-03-18
3
Medium Priority
?
500 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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
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.
Suggested Courses

578 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