Skip to contentSkip to conversation

Busybox syslog tweaks

PATCH Applied Joshua Lock 3 participants 8 messages Jan 17, 2012 – Jan 20, 2012

lore
Share & tools
lore
#0 lore raw

cover Busybox syslog tweaks

The RFC version of this series didn't receive any C's..

This set of changes makes some minor changes to the configuration of busybox's syslog.

The following changes since commit a0f5dd25a37fe3b8664c2133e80b6214559f93f6:

package_rpm.bbclass: Add support for filenames with spaces (2012-01-17 16:20:46 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib josh/syslog
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=josh/syslog

Joshua Lock (5):
busybox: drop MARKINT option from init script and syslog-startup.conf
busybox: remove incorrect comments from syslog-startup.conf
busybox: enable log level configuration in syslog-startup.conf and
script
busybox: change syslog default to log to a file
busybox: enable dropping of duplicates in syslog, off by default

 meta/recipes-core/busybox/busybox-1.19.3/defconfig |    2 +-
 meta/recipes-core/busybox/busybox_1.19.3.bb        |    2 +-
 meta/recipes-core/busybox/files/syslog             |    9 ++++++---
 .../recipes-core/busybox/files/syslog-startup.conf |    9 +++++----
 4 files changed, 13 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.7.5
#1 lore raw

PATCH 1/5 busybox: drop MARKINT option from init script and syslog-startup.conf

This option has been disabled in busybox since 2007 as it was deemed too buggy. See:

http://git.busybox.net/busybox/commit/?id=4998c818919477d90674a3f220e7407c26da17f9

---
 meta/recipes-core/busybox/files/syslog             |    3 ---
 .../recipes-core/busybox/files/syslog-startup.conf |    1 -
 2 files changed, 0 insertions(+), 4 deletions(-)
meta/recipes-core/busybox/files/syslog +0 -3
index 5ff6599..0be412b 100644
@@ -37,9 +37,6 @@ if [ -f /etc/syslog-startup.conf ]; then
 	if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
 		SYSLOG_ARGS="$SYSLOG_ARGS -L"
 	fi
-	if [ -n "$MARKINT" ]; then
-		SYSLOG_ARGS="$SYSLOG_ARGS -m $MARKINT"
-	fi
 	if [ "$REDUCE" = "yes" ]; then
 		SYSLOG_ARGS="$SYSLOG_ARGS -S"
 	fi
meta/recipes-core/busybox/files/syslog-startup.conf +0 -1
index 903a60c..1e4c559 100644
@@ -2,7 +2,6 @@
 # /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
 
 DESTINATION=buffer		# log destinations (buffer file remote)
-MARKINT=20			# interval between --mark-- entries
 LOGFILE=/var/log/messages	# where to log (file)
 REMOTE=loghost:514		# where to log (syslog remote)
 REDUCE=no			# reduce-size logging
Signature · 1 line
1.7.7.5
#2 lore raw

PATCH 2/5 busybox: remove incorrect comments from syslog-startup.conf

In reply to Joshua Lock

Setting rotation size and generations is supported with busybox syslogd

---
 .../recipes-core/busybox/files/syslog-startup.conf |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/busybox/files/syslog-startup.conf +2 -2
index 1e4c559..f58cbe5 100644
@@ -5,7 +5,7 @@ DESTINATION=buffer		# log destinations (buffer file remote)
 LOGFILE=/var/log/messages	# where to log (file)
 REMOTE=loghost:514		# where to log (syslog remote)
 REDUCE=no			# reduce-size logging
-#ROTATESIZE=0			# rotate log if grown beyond X [kByte] (incompatible with busybox)
-#ROTATEGENS=3			# keep X generations of rotated logs (incompatible with busybox)
+#ROTATESIZE=0			# rotate log if grown beyond X [kByte]
+#ROTATEGENS=3			# keep X generations of rotated logs
 BUFFERSIZE=64			# size of circular buffer [kByte]
 FOREGROUND=no			# run in foreground (don't use!)
Signature · 1 line
1.7.7.5
#3 lore raw

PATCH 3/5 busybox: enable log level configuration in syslog-startup.conf and script

In reply to Joshua Lock

It's possible to configure busybox syslog to only log messages above a certain level, expose this functionality through the syslog-startup.conf and syslog init script.

Valid values are 1-8 inclusive.

---
 meta/recipes-core/busybox/files/syslog             |    3 +++
 .../recipes-core/busybox/files/syslog-startup.conf |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
meta/recipes-core/busybox/files/syslog +3 -0
index 0be412b..deeea8b 100644
@@ -40,6 +40,9 @@ if [ -f /etc/syslog-startup.conf ]; then
 	if [ "$REDUCE" = "yes" ]; then
 		SYSLOG_ARGS="$SYSLOG_ARGS -S"
 	fi
+	if [ -n "$LOGLEVEL" ]; then
+	    SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
+	fi
 else
 	# default: log to 16K shm circular buffer
 	SYSLOG_ARGS="-C"
meta/recipes-core/busybox/files/syslog-startup.conf +1 -0
index f58cbe5..83b86f2 100644
@@ -9,3 +9,4 @@ REDUCE=no			# reduce-size logging
 #ROTATEGENS=3			# keep X generations of rotated logs
 BUFFERSIZE=64			# size of circular buffer [kByte]
 FOREGROUND=no			# run in foreground (don't use!)
+#LOGLEVEL=5			# local log level (between 1 and 8)
Signature · 1 line
1.7.7.5
#4 lore raw

PATCH 4/5 busybox: change syslog default to log to a file

In reply to Joshua Lock

This changes the default in syslog-startup.conf to log messages to a file (/var/log/messages) because:

a) we already mount /var/log as a volatile mount by default
b) users are accustomed to looking at /var/log/messages as most distributions don't ship with logread

---
 .../recipes-core/busybox/files/syslog-startup.conf |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-core/busybox/files/syslog-startup.conf +1 -1
index 83b86f2..553490b 100644
@@ -1,7 +1,7 @@
 # This configuration file is used by the busybox syslog init script,
 # /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
 
-DESTINATION=buffer		# log destinations (buffer file remote)
+DESTINATION=file		# log destinations (buffer file remote)
 LOGFILE=/var/log/messages	# where to log (file)
 REMOTE=loghost:514		# where to log (syslog remote)
 REDUCE=no			# reduce-size logging
Signature · 1 line
1.7.7.5
#5 lore raw

PATCH 5/5 busybox: enable dropping of duplicates in syslog, off by default

In reply to Joshua Lock

Busybox syslog includes functionality to drop duplicated syslog entries, enable this feature in the defconfig yet disable it by default.

Expose configuration of the feature through the syslog-startup.conf file and the syslog init script.

---
 meta/recipes-core/busybox/busybox-1.19.3/defconfig |    2 +-
 meta/recipes-core/busybox/busybox_1.19.3.bb        |    2 +-
 meta/recipes-core/busybox/files/syslog             |    3 +++
 .../recipes-core/busybox/files/syslog-startup.conf |    1 +
 4 files changed, 6 insertions(+), 2 deletions(-)
meta/recipes-core/busybox/busybox-1.19.3/defconfig +1 -1
index 1990f28..cd2a2ad 100644
@@ -997,7 +997,7 @@ CONFIG_FEATURE_SH_HISTFILESIZE=y
 CONFIG_SYSLOGD=y
 CONFIG_FEATURE_ROTATE_LOGFILE=y
 CONFIG_FEATURE_REMOTE_LOG=y
-# CONFIG_FEATURE_SYSLOGD_DUP is not set
+CONFIG_FEATURE_SYSLOGD_DUP=y
 CONFIG_FEATURE_SYSLOGD_CFG=y
 CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
 CONFIG_FEATURE_IPC_SYSLOG=y
meta/recipes-core/busybox/busybox_1.19.3.bb +1 -1
index f591856..a075407 100644
@@ -1,5 +1,5 @@
 require busybox.inc
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://udhcpscript.patch \
meta/recipes-core/busybox/files/syslog +3 -0
index deeea8b..2944d3d 100644
@@ -40,6 +40,9 @@ if [ -f /etc/syslog-startup.conf ]; then
 	if [ "$REDUCE" = "yes" ]; then
 		SYSLOG_ARGS="$SYSLOG_ARGS -S"
 	fi
+	if [ "$DROPDUPLICATES" = "yes" ]; then
+	    SYSLOG_ARGS="$SYSLOG_ARGS -D"
+	fi
 	if [ -n "$LOGLEVEL" ]; then
 	    SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
 	fi
meta/recipes-core/busybox/files/syslog-startup.conf +1 -0
index 553490b..fda450a 100644
@@ -5,6 +5,7 @@ DESTINATION=file		# log destinations (buffer file remote)
 LOGFILE=/var/log/messages	# where to log (file)
 REMOTE=loghost:514		# where to log (syslog remote)
 REDUCE=no			# reduce-size logging
+DROPDUPLICATES=no		# whether to drop duplicate log entries
 #ROTATESIZE=0			# rotate log if grown beyond X [kByte]
 #ROTATEGENS=3			# keep X generations of rotated logs
 BUFFERSIZE=64			# size of circular buffer [kByte]
Signature · 1 line
1.7.7.5
Applied
#6 lore raw
In reply to Joshua Lock
Quoted 21 lines · Joshua Lock

The RFC version of this series didn't receive any C's..

This set of changes makes some minor changes to the configuration of busybox's syslog.

The following changes since commit a0f5dd25a37fe3b8664c2133e80b6214559f93f6:

package_rpm.bbclass: Add support for filenames with spaces (2012-01-17 16:20:46 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib josh/syslog
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=josh/syslog

Joshua Lock (5):
busybox: drop MARKINT option from init script and syslog-startup.conf
busybox: remove incorrect comments from syslog-startup.conf
busybox: enable log level configuration in syslog-startup.conf and
script
busybox: change syslog default to log to a file
busybox: enable dropping of duplicates in syslog, off by default

Quoted 6 lines
  meta/recipes-core/busybox/busybox-1.19.3/defconfig |    2 +-
  meta/recipes-core/busybox/busybox_1.19.3.bb        |    2 +-
  meta/recipes-core/busybox/files/syslog             |    9 ++++++---
  .../recipes-core/busybox/files/syslog-startup.conf |    9 +++++----
  4 files changed, 13 insertions(+), 9 deletions(-)

Merged into OE-Core

Thanks
Sau!

#7 lore raw
In reply to Joshua Lock
Quoted 4 lines · Joshua Lock

This set of changes makes some minor changes to the configuration of busybox's
syslog.

I'd like to ask for you to think about a way of sharing the code that parses the conf file between sysv and systemd. My current proposal is:

* move init code to parse the conf file onto a script (possibly /lib/busybox/busybox-syslogd or similar)
* change init to use it
* we change meta-oe to use it as well.

Thoughts?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br