From: W. Trevor King Date: Thu, 3 Jul 2014 23:45:08 +0000 (-0700) Subject: gentoo-syslog/Dockerfile.template: Tweak sources (-system +socket) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d907b2519ae7bfb90644a62f10106e9a54c82b2a;p=dockerfile.git gentoo-syslog/Dockerfile.template: Tweak sources (-system +socket) Don't listen to /proc/kmsg, because Docker doesn't mount it for us. This avoids: * Starting syslog-ng ... Error opening file for reading; filename='/proc/kmsg', error='Operation not permitted (1)' Error initializing message pipeline; * start-stop-daemon: failed to start `/usr/sbin/syslog-ng' * Failed to start syslog-ng [ !! ] * ERROR: syslog-ng failed to start Also add an explicit source listening to /dev/log. I don't have this on my host system, and that syslog-ng creates /dev/log just fine, but my containers seem to need an explicit listing here or they don't create /dev/log. Reported-by: Oleg Terenchuk --- diff --git a/gentoo-syslog/Dockerfile.template b/gentoo-syslog/Dockerfile.template index 193ea93..04aaf01 100644 --- a/gentoo-syslog/Dockerfile.template +++ b/gentoo-syslog/Dockerfile.template @@ -33,6 +33,12 @@ ADD tail-syslog.sh /usr/bin/tail-syslog # Disable logging to tty12 RUN sed -i 's/^\([^#].*console_all.*\)/#\1/' /etc/syslog-ng/syslog-ng.conf +# Disable the system source (/proc/kmsg) +RUN sed -i 's/^\(.*\)system(); \(.*\)/\1\2/' /etc/syslog-ng/syslog-ng.conf + +# Enable /dev/log +RUN sed -i 's|^\(.* internal();\)\(.*\)|\1 unix-stream("/dev/log");\2|' /etc/syslog-ng/syslog-ng.conf + # Log boot process to /var/log/rc.log RUN sed -i 's/^#\(rc_logger="YES"\)$/\1/' /etc/rc.conf