add telegraf log directory /var/log/kolla/telegraf

Closes-Bug: #1622609

Change-Id: I89d4059e2c31b7f1737c147479cdc3c36b06fa69
This commit is contained in:
zhubingbing 2016-09-12 13:28:14 +00:00
parent 8249f3a188
commit 388eee2eab
2 changed files with 13 additions and 0 deletions

View File

@ -6,8 +6,11 @@ MAINTAINER {{ maintainer }}
{{ macros.install_packages(telegraf_packages | customizable("packages")) }}
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 \
&& chmod 440 /etc/sudoers.d/kolla_telegraf_sudoers \
&& chmod 755 /usr/local/bin/kolla_telegraf_extend_start \
&& usermod -a -G kolla telegraf
{% 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