Merge "add telegraf log directory /var/log/kolla/telegraf"

This commit is contained in:
Jenkins 2016-09-13 07:40:45 +00:00 committed by Gerrit Code Review
commit a9c98ba58c
2 changed files with 13 additions and 0 deletions

View File

@ -6,8 +6,11 @@ MAINTAINER {{ maintainer }}
{{ macros.install_packages(telegraf_packages | customizable("packages")) }} {{ macros.install_packages(telegraf_packages | customizable("packages")) }}
COPY telegraf_sudoers /etc/sudoers.d/kolla_telegraf_sudoers COPY telegraf_sudoers /etc/sudoers.d/kolla_telegraf_sudoers
COPY extend_start.sh /usr/local/bin/kolla_telegraf_extend_start
RUN chmod 750 /etc/sudoers.d \ RUN chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/kolla_telegraf_sudoers \ && chmod 440 /etc/sudoers.d/kolla_telegraf_sudoers \
&& chmod 755 /usr/local/bin/kolla_telegraf_extend_start \
&& usermod -a -G kolla telegraf && usermod -a -G kolla telegraf
{% block telegraf_footer %}{% endblock %} {% block telegraf_footer %}{% endblock %}

View File

@ -0,0 +1,10 @@
#!/bin/bash
TELEGRAF_LOG_DIR="/var/log/kolla/telegraf"
if [[ ! -d "${TELEGRAF_LOG_DIR}" ]]; then
mkdir -p ${TELEGRAF_LOG_DIR}
fi
if [[ $(stat -c %a ${TELEGRAF_LOG_DIR}) != "755" ]]; then
chmod 755 ${TELEGRAF_LOG_DIR}
fi