From e0eda2d1e075b451b96d9eb434f61c4711786daa Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Tue, 8 Nov 2016 11:50:38 +0000 Subject: [PATCH 1/2] Remove syslog conf file We are not using busybox syslog any more so this is unused. Signed-off-by: Justin Cormack --- alpine/etc/conf.d/syslog | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 alpine/etc/conf.d/syslog diff --git a/alpine/etc/conf.d/syslog b/alpine/etc/conf.d/syslog deleted file mode 100644 index 53ccb79d4..000000000 --- a/alpine/etc/conf.d/syslog +++ /dev/null @@ -1,5 +0,0 @@ -# Would prefer to check [ -S /var/run/syslog.vsock ] but it doesn't -# always exist by the time we get here starts. -if [ -e /var/run/vsudd.pid -a ! -d /sys/bus/vmbus ] ; then - SYSLOGD_OPTS="-R local:/var/run/syslog.vsock" -fi From f69f9a3427b1a5b02c0c86aa24899a9cb9c0be20 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Tue, 8 Nov 2016 14:04:51 +0000 Subject: [PATCH 2/2] Use syslog local0 for docker logs This allows log rotation, redirect via syslog etc. Signed-off-by: Justin Cormack --- alpine/etc/syslog.conf | 29 ++++++++++++++++++++++++ alpine/packages/docker/etc/init.d/docker | 6 ++--- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 alpine/etc/syslog.conf diff --git a/alpine/etc/syslog.conf b/alpine/etc/syslog.conf new file mode 100644 index 000000000..b74275b6c --- /dev/null +++ b/alpine/etc/syslog.conf @@ -0,0 +1,29 @@ +# /etc/syslog.conf Configuration file for syslogd. +# +# For more information see syslog.conf(5) +# manpage. + +# First some standard logfiles. Log by facility. +# + +auth,authpriv.* /var/log/auth.log +*.*;auth,authpriv.none -/var/log/syslog +cron.* /var/log/cron.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +lpr.* -/var/log/lpr.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log + +# Local facilities for our programs +local0.* -/var/log/docker.log + +# Some `catch-all' logfiles. +# +*.=debug;\ + auth,authpriv.none;\ + news.none;mail.none -/var/log/debug +*.=info;*.=notice;*.=warning;\ + auth,authpriv.none;\ + cron,daemon.none;\ + mail,news.none -/var/log/messages diff --git a/alpine/packages/docker/etc/init.d/docker b/alpine/packages/docker/etc/init.d/docker index 2d47866b4..e2e366f73 100755 --- a/alpine/packages/docker/etc/init.d/docker +++ b/alpine/packages/docker/etc/init.d/docker @@ -111,11 +111,9 @@ start() start-stop-daemon --start --quiet \ --background \ - --exec ${command} \ + --startas /bin/sh \ --pidfile ${pidfile} \ - --stderr "${DOCKER_LOGFILE}" \ - --stdout "${DOCKER_LOGFILE}" \ - -- --pidfile=${pidfile} ${DOCKER_OPTS} + -- -c "exec ${command} --pidfile=${pidfile} ${DOCKER_OPTS} 2>&1 | logger -p local0.info" ewaitfile 20 ${pidfile} /var/run/docker.sock /var/run/docker/libcontainerd/docker-containerd.sock