gentoo-syslog/Dockerfile.template: Tweak sources (-system +socket)
authorW. Trevor King <wking@tremily.us>
Thu, 3 Jul 2014 23:45:08 +0000 (16:45 -0700)
committerW. Trevor King <wking@tremily.us>
Thu, 3 Jul 2014 23:56:40 +0000 (16:56 -0700)
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 <litwol@litwol.com>
gentoo-syslog/Dockerfile.template

index 193ea93ae02623feb382d127cfc817e0d2443a2d..04aaf01c20e746e8e79428b7e71bbfda45d76936 100644 (file)
@@ -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 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
 
 # Log boot process to /var/log/rc.log
 RUN sed -i 's/^#\(rc_logger="YES"\)$/\1/' /etc/rc.conf