2013-04-29
We like our Linux kernels chatty during ...
We like our Linux kernels chatty during boot, seeing stuff in the startup messages likeserial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A 00:07: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550Ais perfectly fine with us. Defaults with several linux distributions are going the other way. For CentOS we already disable the plymouth splash screen, but to disable more eyecandy and get real kernel messages the commandline options rhgb and quiet need to be removed from the kernel commandline in the grub config. Option rhgb enables 'red hat graphic boot' and option quiet disables most kernel messages. Via How do I set the default kernel parameters in CentOS for all existing and future kernels? - Server Fault I found the right way. The next step was to turn this into a puppet recipe so this is done automatically:class serverpackages::fixgrubconfig { exec { "Clean grub default options": path => "/sbin:/bin", onlyif => 'egrep -c \'(rhgb|quiet)\' /boot/grub/grub.conf', command => '/usr/local/sbin/normalizegrubconfig', require => file["normalizegrubconfig"]; } file { "normalizegrubconfig": path => '/usr/local/sbin/normalizegrubconfig', ensure => present, owner => 'root', group => 'root', mode => 0700, content => '#!/bin/sh # # THIS FILE IS UNDER PUPPET CONTROL # reset grub config for all kernels for KERNEL in /boot/vmlinuz-* ; do grubby --update-kernel="$KERNEL" --remove-args="rhgb quiet" done '; } }Problem solved, yet another thing puppet adds to the baseline configuration. The upside of using grubby to manage this is that 'creating correct grub config files' is builtin into grubby.