Sending Errors to A Specific Console?

Jude DaShiell jdashiel at shellworld.net
Tue Nov 1 08:10:53 UTC 2011


or try sudo cat /proc/kmsg & <cr> and leave out the control-c.On Sun, 30 
Oct 2011, Tim Chase wrote:

> On 10/30/11 19:18, Hart Larry wrote:
> > So my idea would be if first I could select a console such as
> > tty22  where all error messages would go.
> 
> If you su/sudo to root, you can use "cat" to read the contents of /proc/kmsg
> so for your example, I'd switch to console #22, and type
> 
>   sudo cat /proc/kmsg
> 
> and all system/kernel messages should appear in this console as they would if
> you were monitoring the output of "dmesg -r"
> 
> Note that the "cat" command (or the following "sed" command) both hang
> awaiting additional output, so you have to use control+C to terminate them if
> you're experimenting rather than just leaving them running in the background.
> 
> > Then for those who figure its important to know of and examine
> > them, maybe the PC speaker could ring 2 rapid bells.
> 
> Using the above command, you could do something like
> 
>   sudo sed '/^<[6]>/&\x07\x07/' /proc/kmsg
> 
> which would send two BELL characters to this console if the logging level (the
> first field in angled-brackets is the logging level, which you can see if you
> use "dmesg -r") was one of the defined set.  In this case, I just log-level 6
> since that gives me most of what I would find important, but you can change it
> to something like "[367]" to log levels 3, 6, and 7, or even just
> 
>   sudo sed 's/^/\x07\x07/' /proc/kmsg
> 
> though this has the unfortunate side effect of ringing twice for EVERY line
> printed, which I think would annoy the SNOT out of me. <grins>
> 
> 
> I don't know of these are the best solutions--especially the part where it
> involves leaving a console open with root access if you use "su" instead of
> configuring "sudo"; perhaps for this you could chown/chmod the file like
> 
>   chown :plugdev /proc/kmsg
>   chmod g+r /proc/kmsg
> 
> and then run it as your regular user.  I don't know if this will work for you,
> but hopefully it's at least a start.
> 
> -tim
> 
> 
> 
> 
> _______________________________________________
> Blinux-list mailing list
> Blinux-list at redhat.com
> https://www.redhat.com/mailman/listinfo/blinux-list
> 
> 

Jude <jdashiel at shellworld.net>
When people ask do you believe in Numerology, the proper reply for me at
least is do you believe in a hammer?  The proper answer for me for both
questions is no, they're both tools and to be used under appropriate
circumstances.




More information about the Blinux-list mailing list