Silencing Linux console output

5,898

Solution 1

Haven't tried it, but you should be able to add "console=/dev/null" to the kernel parameters in grub or lilo. If not, try console=ttyS0 to redirect to the serial port (assuming you don't have anything connected to the serial port, maybe a non-existant serial port would be safer such as console=ttyS7).

Solution 2

According to Documentation/kernel-parameters.txt, the loglevel=0 kernel cmdline argument should silence all kernel messages. It'd be better to use at least 3 or 4, though, to still allow critical errors to be displayed.

loglevel=       All Kernel Messages with a loglevel smaller than the
                console loglevel will be printed to the console. It can
                also be changed with klogd or other programs. The
                loglevels are defined as follows:

                0 (KERN_EMERG)          system is unusable
                1 (KERN_ALERT)          action must be taken immediately
                2 (KERN_CRIT)           critical conditions
                3 (KERN_ERR)            error conditions
                4 (KERN_WARNING)        warning conditions
                5 (KERN_NOTICE)         normal but significant condition
                6 (KERN_INFO)           informational
                7 (KERN_DEBUG)          debug-level messages

As for startx, normal redirection should work:

startx >/dev/null 2>&1
Share:
5,898

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin almost 2 years

    I installed a minimalist distribution for my mom to use, it uses rungetty to autologin and an init script that just does 'startx'. Everything works great but when she goes to shutdown, it drops back to the console for a while before turning off (Old PC).

    Is there a way to pipe or silence all output to tty1/console. When X closes, the screen should be blank and then turn off.

    Thanks