8

I'm working on a curses GUI that is supposed to start up automatically on boot-up in the default linux terminal (I have no X server installed). I have this working great, but I have a problem where shortly after my curses application starts, the OS will dump some information to the terminal, which messes up my GUI. Something about "read-ahead cache" pops up every time. I have also seen messages displayed when I insert a USB flash drive or some other device.

Is there a way to prevent these messages from being sent to /dev/tty1?

10

You can use the command dmesg -n1 to prevent all messages, except panic messages, from appearing on the console.

To make this change permanent, modify your /etc/sysctl.conf file to include the following setting (the first 3 is the important part).

kernel.printk = 3 4 1 3

See this post for information on the kernel.printk values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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