From c5fb64d61f1462d0f8790838424722e161ba4024 Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Tue, 27 Sep 2011 18:15:08 +0200 Subject: [PATCH] Make dmesg log optional Reported-by: Patrick X-Gentoo-Bug: 384485 X-Gentoo-Bug-URL: https://bugs.gentoo.org/384485 --- conf.d/bootmisc | 4 ++++ init.d/bootmisc.in | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/conf.d/bootmisc b/conf.d/bootmisc index 2c1670b5..d79706cc 100644 --- a/conf.d/bootmisc +++ b/conf.d/bootmisc @@ -4,3 +4,7 @@ clean_tmp_dirs="/tmp" # Should we wipe the tmp paths completely or just selectively remove known # locks / files / etc... ? wipe_tmp="YES" + +# Write the initial dmesg log into /var/log/dmesg after boot +# This may be useful if you need the kernel boot log afterwards +log_dmesg="YES" diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index 6607f45c..2ca79265 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -16,6 +16,7 @@ dir_writeable() } : ${wipe_tmp:=${WIPE_TMP:-yes}} +: ${log_dmesg:=${LOG_DMESG:-yes}} cleanup_tmp_dir() { @@ -142,11 +143,13 @@ start() fi fi - if $logw || dir_writeable /var/log; then - # Create an 'after-boot' dmesg log - if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ ]; then - dmesg > /var/log/dmesg - chmod 640 /var/log/dmesg + if yesno $log_dmesg; then + if $logw || dir_writeable /var/log; then + # Create an 'after-boot' dmesg log + if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ ]; then + dmesg > /var/log/dmesg + chmod 640 /var/log/dmesg + fi fi fi