Busybox syslog tweaks
cover Busybox syslog tweaks
This RFC series makes some minor changes to the configuration of busybox's syslog. The only one I think may be contentious, and why I've made this an RFC, is the 4th patch "busybox: change syslog default to log to a file" which changes the long-default behaviour.
Please review the following changes for suitability for inclusion. If you have any objections or suggestions for improvement, please respond to the patches. If you agree with the changes, please provide your Acked-by.
Cheers,
Joshua
The following changes since commit d5b8caac0e7fc4b05c76b4d3da0508e2a53f28cd:
package.bbclass: per recipe PRSERV_HOST support (2012-01-11 10:33:24 +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
RFC 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
@@ -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
@@ -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
RFC PATCH 2/5 busybox: remove incorrect comments from syslog-startup.conf
In reply to Joshua LockSetting 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
@@ -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
RFC PATCH 3/5 busybox: enable log level configuration in syslog-startup.conf and script
In reply to Joshua LockIt'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
@@ -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
@@ -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
RFC PATCH 4/5 busybox: change syslog default to log to a file
In reply to Joshua LockThis 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
@@ -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
RFC PATCH 5/5 busybox: enable dropping of duplicates in syslog, off by default
In reply to Joshua LockBusybox 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
@@ -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
@@ -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
@@ -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
@@ -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