From 916d920bfb6b6bdd8fd16920330c63447d5ac685 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 27 May 2016 13:16:30 +0100 Subject: [PATCH] Direct syslog to log to /var/run/syslog.vsock on mac Avoid doing this on non-Docker-for-{Mac,Win} editions (which don't run vsudd) by checking for vsudd.pid and avoid doing it on Docker-for-Win (for now) by checking for /sys/bus/vmbus (as /etc/init.d/vsudd does too). Ideally we would just check for /var/run/syslog.vsock but this may not have arrived yet (typically vsudd is now started immediately prior to syslog and it forks via start-stop-daemon and thus before it creates the socket). Since syslogd will reopen as needed we don't want to delay boot either here or in the vsudd initscript to await the arrival of the socket. Signed-off-by: Ian Campbell --- alpine/etc/conf.d/syslog | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 alpine/etc/conf.d/syslog diff --git a/alpine/etc/conf.d/syslog b/alpine/etc/conf.d/syslog new file mode 100644 index 000000000..53ccb79d4 --- /dev/null +++ b/alpine/etc/conf.d/syslog @@ -0,0 +1,5 @@ +# 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