diff --git a/docker/collectd/Dockerfile.j2 b/docker/collectd/Dockerfile.j2 index 532321f9a5..ded2fa271d 100644 --- a/docker/collectd/Dockerfile.j2 +++ b/docker/collectd/Dockerfile.j2 @@ -8,13 +8,10 @@ MAINTAINER {{ maintainer }} ] %} {{ macros.install_packages(collectd_packages | customizable("packages")) }} -COPY collectd_sudoers /etc/sudoers.d/kolla_collectd_sudoers COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN useradd -r -m collectd \ && chmod 755 /usr/local/bin/kolla_extend_start \ - && chmod 750 /etc/sudoers.d \ - && chmod 440 /etc/sudoers.d/kolla_collectd_sudoers \ && usermod -a -G kolla collectd \ && chown -R collectd /var/lib/collectd \ && chown -R collectd /etc/collectd* \ diff --git a/docker/collectd/collectd_sudoers b/docker/collectd/collectd_sudoers deleted file mode 100644 index fae410a997..0000000000 --- a/docker/collectd/collectd_sudoers +++ /dev/null @@ -1 +0,0 @@ -%kolla ALL=(root) NOPASSWD: /bin/chown collectd\: /var/lib/collectd/, /usr/bin/chown collectd\: /var/lib/collectd/ diff --git a/docker/collectd/extend_start.sh b/docker/collectd/extend_start.sh index 92ff4a5ea3..80ef63db34 100644 --- a/docker/collectd/extend_start.sh +++ b/docker/collectd/extend_start.sh @@ -1,6 +1,8 @@ #!/bin/bash -# Only update permissions if permissions need to be updated -if [[ $(stat -c %U:%G /var/lib/collectd) != "collectd:collectd" ]]; then - sudo chown collectd: /var/lib/collectd +if [[ ! -d "/var/log/kolla/collectd" ]]; then + mkdir -p /var/log/kolla/collectd +fi +if [[ $(stat -c %a /var/log/kolla/collectd) != "755" ]]; then + chmod 755 /var/log/kolla/collectd fi