From 1dfa9c79f9ca3a1f98ec45b95308944bf9261e35 Mon Sep 17 00:00:00 2001 From: inc0 Date: Thu, 20 Aug 2015 12:34:32 +0200 Subject: [PATCH] rsyslog container First container from logging stack Change-Id: I8c8b6743e22a38969cb8a741f3176c5aed24f549 Implements: bp logging-container --- docker/logging/rsyslog/Dockerfile.j2 | 17 +++++++++++++++++ docker/logging/rsyslog/config-external.sh | 11 +++++++++++ docker/logging/rsyslog/start.sh | 14 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100755 docker/logging/rsyslog/Dockerfile.j2 create mode 100755 docker/logging/rsyslog/config-external.sh create mode 100755 docker/logging/rsyslog/start.sh diff --git a/docker/logging/rsyslog/Dockerfile.j2 b/docker/logging/rsyslog/Dockerfile.j2 new file mode 100755 index 0000000000..041cc843f4 --- /dev/null +++ b/docker/logging/rsyslog/Dockerfile.j2 @@ -0,0 +1,17 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %} +RUN yum -y install \ + rsyslog \ + && yum clean all +{% elif base_distro in ['ubuntu', 'debian'] %} +RUN apt-get install -y --no-install-recommends \ + rsyslog \ + && apt-get clean +{% endif %} + +COPY config-external.sh /opt/kolla/ +COPY start.sh / + +CMD ["/start.sh"] diff --git a/docker/logging/rsyslog/config-external.sh b/docker/logging/rsyslog/config-external.sh new file mode 100755 index 0000000000..4352a6f08e --- /dev/null +++ b/docker/logging/rsyslog/config-external.sh @@ -0,0 +1,11 @@ +#!/bin/bash +SOURCE="/opt/kolla/rsyslog/rsyslog.conf" +TARGET="/etc/rsyslog.conf" +OWNER="root" + +if [[ -f "$SOURCE" ]]; then + rm $TARGET + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/logging/rsyslog/start.sh b/docker/logging/rsyslog/start.sh new file mode 100755 index 0000000000..e005d7f435 --- /dev/null +++ b/docker/logging/rsyslog/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/sbin/rsyslogd" +ARGS="-n" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS