Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to add a line to the inittab that will create a terminal console, lets say tty11, and I would like that console to display the output from dmesg. (this tty will have no other purpose in life but to output dmesg)
this would allow me to press alt+f11 at any time to view anything that might have changed/updated both during the boot process and after.
In inittab, you add a line like (in you are running standard sysV init):
c7:2345:respawn:bash -c "cat /proc/kmsg >/dev/tty11"
or you can add it anywhere in your boot process (like in /etc/rc.d or anywhere your distro execute the code)
line in the inittab and I get messages on tty1 saying that c7 will be halted for 5 min.
when I switch over to tty11 I see no output
also tried:
c7:2345:respawn:bash -c "dmesg -c >/dev/tty11"
while I was able to see the information I expected to see on tty11 but I was unable to scroll up or down, and I was still recieving the c7 will be halted for 5min messages on tty1
I like the output generated by dmesg, it is helpful when different events trigger... such as inserting a usb device ...it is also helpful to be able to see what is going on during the boot process, so I can learn how things are being loaded.
I must be missing something...
as for the console=tty11 setting, I do not have the /boot/grub/menu.lst file.
Last edited by joeuser123; 02-26-2009 at 04:11 PM.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
another thought would be to create a shell script
such as
Code:
#!/bin/bash
x=0
while ((x==0))
do
dmesg | tail
for ((z=1;z<=1000000;z++)) do y=3;done
done
log in to any existing tty that you don't plan to use
and run the script
the above example runs dmesg, waits, dumps dmesg again etc.. until you kill the program with ctl-c
or a more fancy example
Code:
#!/bin/bash
x=0
while ((x==0))
do
dmesg | tail --lines=(number of lines to dump) > /dev/tty11
for ((z=1;z<=1000000;z++)) do y=3;done
done
which would dump the last (number of lines) from dmesg to /dev/tty11
and could be run at any terminal by sh myscript.sh&
does it work if you just type bash -c "cat /proc/kmsg >/dev/tty11" on the terminal as root?
expected result: the command should hang and you should see kernel messages on /des/tty11 (only new messages, not old ones). At first if will not print anything but if you insert a module it should be printed there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.