Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to redirect, ie create /dev/null as non-null device, like /dev/console or /dev/stdout? This obviously has to be done before init runs create creates a standard /dev/null. Upstart seems to dislike simple symlink to /dev/stdout.

share|improve this question
    
Upstart seems to dislike simple symlink Ofcourse it does not ;) Symlinks can be created across filesystems and you do not need a lot of imagination to come up with what happens when a disc is not present when upstart needs it. –  Rinzwind Feb 13 '13 at 14:12
    
@Rinzwind: /dev/stdout is hardly on any other filesystem, but yes, symlink is not the way to go. –  Tuminoid Feb 13 '13 at 20:36
add comment

1 Answer

Wikipedia

/dev/null or the null device is a special file that discards all data written to it (but reports that the write operation succeeded) and provides no data to any process that reads from it

The answer is no: redirecting from /dev/null is impossible since, after /dev/null is done there is nothing left to redirect. You need to alter the program you want to see the messages from to echo these results to a log file before a /dev/null comes into play.

share|improve this answer
    
Please read the question again. I'm not debugging any jobs. I'm also making it clear any switch needs to be done prior running init (Upstart) which creates /dev/null IF it is not present. –  Tuminoid Feb 13 '13 at 20:34
    
Answer is still no. –  Rinzwind Feb 13 '13 at 21:15
    
Can you revise your answer then to reflect the question, and I'll then accept it (ie. I'm creating /dev/null to whatever I wish, and not trying to fix it after being created as null device.) –  Tuminoid Feb 14 '13 at 7:40
    
i think what R was saying is that if you did do this, it would create a huge security hole and probably be considered, at least at some level, malicious intent, even if it is not intended to be that way, since /dev/null is intended to discard and hide output, and sometimes it is sensitive data that should not be seen, ever... any uppity noseity programmer is going to give you a no. That does not however mean that it is impossible.. just means that it probably would be viewed in a negative light if you did. PS: i know its late but I try to put comments in where they look like they are needed :) –  osirisgothra Mar 1 at 12:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.