From 7a30d4d7689299ed1f0007326ba782b5047c1188 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Tue, 23 May 2023 16:14:21 +0200 Subject: [PATCH] opensearch-dashboards: Fix permissions Since we moved to using rpm/deb packages, the user has changed. Related-Bug: #2020152 Change-Id: I2a5a0d761223b4e99c8df59f80261108380d5038 (cherry picked from commit 6786e4384c1a19e4658310e109b8ab9704f5eff9) --- docker/opensearch/opensearch-dashboards/Dockerfile.j2 | 4 ++-- docker/opensearch/opensearch-dashboards/extend_start.sh | 8 ++++---- kolla/common/config.py | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docker/opensearch/opensearch-dashboards/Dockerfile.j2 b/docker/opensearch/opensearch-dashboards/Dockerfile.j2 index 6819b9458d..8433260101 100644 --- a/docker/opensearch/opensearch-dashboards/Dockerfile.j2 +++ b/docker/opensearch/opensearch-dashboards/Dockerfile.j2 @@ -7,7 +7,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% import "macros.j2" as macros with context %} -{{ macros.configure_user(name='opensearch', shell='/bin/bash', homedir='/usr/share/opensearch') }} +{{ macros.configure_user(name='opensearch-dashboards', shell='/bin/bash', homedir='/usr/share/opensearch-dashboards') }} {{ macros.enable_extra_repos(['opensearch-dashboards']) }} {% set opensearch_dashboards_packages = ['opensearch-dashboards'] %} @@ -30,4 +30,4 @@ RUN chmod 755 /usr/local/bin/kolla_extend_start {% block opensearch_footer %}{% endblock %} {% block footer %}{% endblock %} -USER opensearch +USER opensearch-dashboards diff --git a/docker/opensearch/opensearch-dashboards/extend_start.sh b/docker/opensearch/opensearch-dashboards/extend_start.sh index fa7872738f..608bb34bf4 100644 --- a/docker/opensearch/opensearch-dashboards/extend_start.sh +++ b/docker/opensearch/opensearch-dashboards/extend_start.sh @@ -1,10 +1,10 @@ #!/bin/bash -if [[ ! -d "/var/log/kolla/opensearch" ]]; then - mkdir -p /var/log/kolla/opensearch +if [[ ! -d "/var/log/kolla/opensearch-dashboards" ]]; then + mkdir -p /var/log/kolla/opensearch-dashboards fi -if [[ $(stat -c %a /var/log/kolla/opensearch) != "755" ]]; then - chmod 755 /var/log/kolla/opensearch +if [[ $(stat -c %a /var/log/kolla/opensearch-dashboards) != "755" ]]; then + chmod 755 /var/log/kolla/opensearch-dashboards fi export DASHBOARDS_HOME=/usr/share/opensearch-dashboards diff --git a/kolla/common/config.py b/kolla/common/config.py index 5a3514b97a..6d7d151b0e 100755 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -960,6 +960,10 @@ USERS = { 'opensearch-user': { 'uid': 42490, 'gid': 42490, + }, + 'opensearch-dashboards-user': { + 'uid': 42492, + 'gid': 42492, } }