Subject: [alpine-aports] [PATCH] main/busybox: disable syslog to kernel printk buffer

From: Sören Tempel <[email-masked]>
Date: Mon, 27 Jul 2015 23:40:28 +0200

I quote the .config file: "klogd should not be used together with syslog
to kernel printk buffer."
---
 main/busybox/APKBUILD      |  8 ++++----
 main/busybox/busyboxconfig | 10 +++-------
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 0d0ebb7..19f4d26 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=busybox
 pkgver=1.23.2
-pkgrel=4
+pkgrel=5
 pkgdesc="Size optimized toolbox of many common UNIX utilities"
 url=http://busybox.net
 arch="all"
@@ -130,7 +130,7 @@ e1c183cbe1ca18a0fa0d9597314076c9  0001-ifupdown-use-x-hostname-NAME-with-udhcpc.
 699ce5aa1095ba4419cd595cec8a8f75  1000-fbsplash-use-virtual-y-size-in-mmap-size-calculation.patch
 b56d306ccba574da78dff060b7330806  1001-fbsplash-support-console-switching.patch
 4fe5f9e973674c7db3d07f295c363a7c  1002-fbsplash-support-image-and-bar-alignment-and-positio.patch
-02bed42873ec3ced104a1648be4ae825  busyboxconfig
+a49ec891c8d06983b8dcdbd7d546b795  busyboxconfig
 befaac2c59c380e36a452b3f1c1d4a3a  glibc.patch"
 sha256sums="05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a  busybox-1.23.2.tar.bz2
 81957f1fe0c386120dad1c8174ccc1fcfeed98c14d229db7d164d4fb4c938b3d  bbsuid.c
@@ -147,7 +147,7 @@ ac2cd5fed91bfaec22ed1f2766396d0feb29b9b96f20b2c12d5d8ac8769afae9  0001-linedit-d
 043963183cad556bdae5d5608180f0cb76cf7eede175cd97aa002a787780500f  1000-fbsplash-use-virtual-y-size-in-mmap-size-calculation.patch
 b8b0b16ed67b0159256193b1d2108b8ef9aa8a334ab81e463bb970c71257da9a  1001-fbsplash-support-console-switching.patch
 e1f3fad8e21dfd72cfcae7ab3ba31d7938e964e0f9ec08b2da0b14d462435424  1002-fbsplash-support-image-and-bar-alignment-and-positio.patch
-9125cb9be070fa3dc61afdbe36ad60464b67ceceaf1faecf564824a65ca5d5e0  busyboxconfig
+91e4753f54b5d86051521f50175164cd31e29eb1f4f92e300f21694621f6cfb5  busyboxconfig
 c604ef791c31d35a8c5ee4558d21428a46f37a6d762c4a7e29864f4037fc44a0  glibc.patch"
 sha512sums="209c8ef26e40ccb81510f6b663202b080f9bbecac7faf386bbabf7e36a43d63b15dd6ce9f7a84c1ccc5345c524999812251da1e113ef9faadc6af1fedd24c7c9  busybox-1.23.2.tar.bz2
 16b3dd6a8b76b062d51458351fcb44f84b49eb4bf898584c933df90fb2cb3966f9547865a4d7447589bb20b7c203beb04ff7512f76f85d29138d2cff4eb9ee81  bbsuid.c
@@ -164,5 +164,5 @@ a35b66cd28b79ccc14b47315ac94677fdf8c14d8a6e8956707e71fb50d453dfc5b4b822832cd1fae
 2a8e9360e1cedd26bdb70d8cc036ef0abc7588bf2eee147c1c7436d7a40763f8e31d346b980145a36649130a2f811d299e4f46f7e1b60a8165a60ae9e79727d5  1000-fbsplash-use-virtual-y-size-in-mmap-size-calculation.patch
 a181dd54e8e11cf1199edb1b1fcd4b7402bbf142593b6014f32c6815bb7093b56899ad0fcc9f73c382f56203ac5274fb3d51fa070feb541436f23c31680f1a69  1001-fbsplash-support-console-switching.patch
 c33073416f7da2805a20f3f456f869217171c8fbfdef85f4ae481307aeb1e1b5717084bbbc619010fa5500c3f3f49b6468d5c122024fcc49d637c82427a3f553  1002-fbsplash-support-image-and-bar-alignment-and-positio.patch
-05a2e8ba596af76263cd8da1eb71d4d4ea32a23651179307336bb4f84ba44dc0b07bc8dfaa55efe8f5d3c8746f342e7024d4723b709fd1bd78fa0bfa3d35eeb2  busyboxconfig
+9dd2ab1feac887b7cc55039b825beec1694cb482944d55438018a75c1949be2458dda68fc9093c1c3d1bfead906579cd8f5db5d6a47f75ef63f9eea1b4ecd687  busyboxconfig
 1d2739379dab1deb3eae7cffd4845300eb7d30f7343b4a1209b21a5680860d55080ad45fdefe098b249ce3040c01951fa7f0a79cd447b2d7b260eb000099d9dc  glibc.patch"
diff --git a/main/busybox/busyboxconfig b/main/busybox/busyboxconfig
index d0fa272..d6b4843 100644
--- a/main/busybox/busyboxconfig
+++ b/main/busybox/busyboxconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Busybox version: 1.23.2
-# Wed Jul 22 20:40:01 2015
+# Mon Jul 27 23:35:50 2015
 #
 CONFIG_HAVE_DOT_CONFIG=y
 
@@ -158,8 +158,8 @@ CONFIG_GZIP=y
 CONFIG_GZIP_FAST=2
 CONFIG_LZOP=y
 # CONFIG_LZOP_COMPR_HIGH is not set
-# CONFIG_RPM2CPIO is not set
 # CONFIG_RPM is not set
+# CONFIG_RPM2CPIO is not set
 CONFIG_TAR=y
 CONFIG_FEATURE_TAR_CREATE=y
 # CONFIG_FEATURE_TAR_AUTODETECT is not set
@@ -1049,11 +1049,7 @@ CONFIG_FEATURE_IPC_SYSLOG=y
 CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
 CONFIG_LOGREAD=y
 CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
-CONFIG_FEATURE_KMSG_SYSLOG=y
+# CONFIG_FEATURE_KMSG_SYSLOG is not set
 CONFIG_KLOGD=y
-
-#
-# klogd should not be used together with syslog to kernel printk buffer
-#
 CONFIG_FEATURE_KLOGD_KLOGCTL=y
 CONFIG_LOGGER=y
-- 
2.4.6

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 28 Jul 2015 16:18:11 +0200

On Mon, 27 Jul 2015 23:40:28 +0200

>  2 files changed, 7 insertions(+), 11 deletions(-)

Thanks for the patch.

As I understand, the problem is that klogd will grab kernel messages
(from /dev/klog) and send them to syslog, while syslog -K does the
opposite, makes syslog write log as kernel messages instead of writing
to a file.

This is trick to use 'dmesg' for you syslog and avoid logfile and
logrotation.

So basically, if you enable syslog -K and run klogd, then you will
create a loop, kernel messages -> syslog -> kernel message.

I don't know if its worth disable the feature at compile time. As long
as you don't run klogd and syslogd -K at the same time you should be
fine.

We normally don't try prevent users from shooting themselves in the
foot.

Are there other good reason to apply it? Maybe I am missing something...

-nc

---

---

From: Sören Tempel <[email-masked]>
Date: Fri, 7 Aug 2015 16:39:23 +0200

> Are there other good reason to apply it? Maybe I am missing something...

No, you are correct. Please reject this patch.

Sören.

---