0

Is there any way to silence the output that occurs on TTY1 when switching runlevels?

I'm talking about the output like in the following image: enter image description here

I have a simple UI that may be running on TTY1 when the runlevel is changed and it corrupts the curses output, which looks very ugly.

1

Probably not: those messages are written to the console, and your TTY1 is just one of the virtual consoles that happen to be using it.

The service stop/start messages are not written by a child process of your command (otherwise you could redirect them to /dev/null).

On the other hand, you can suppress some other types of messages written to the console (kernel messages, as mentioned in How do I disable messages or logging from printing on the console/virtual terminals?).

But in a quick check of CentOS 7, neither redirecting the output of init nor using dmesg -n 1 affects messages sent going from runlevel 5 to 3. The command-shell does get logged out (which would be expected for your program as well).

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.