From 7761ae38d487bd074a3d5e2bab50924588772243 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Tue, 12 Mar 2019 11:38:51 +0100 Subject: [PATCH] Fix idempotency for horizon container logs Whenever /var/log/horizon/horizon.log recreated as a root, the touch command fails, and the chown commands got skipped. This results in idempotency issues when the logs path become accessed under mismatching user. Fix this by making the chown command always applying disregard of the touch command results. Closes-Bug: #1819626 Change-Id: Ied538dbc7dbd311361108747a1e89d1f5740eedd Signed-off-by: Bogdan Dobrelya (cherry picked from commit 95e142d84eeaf82b23323bb3a8eab1e4f6a9e005) --- docker/services/horizon.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/services/horizon.yaml b/docker/services/horizon.yaml index 3347e44cce..57c4c54292 100644 --- a/docker/services/horizon.yaml +++ b/docker/services/horizon.yaml @@ -113,7 +113,7 @@ outputs: # FIXME Apache needs to read files in /etc/openstack-dashboard # Need to set permissions to match the BM case, # http://paste.openstack.org/show/609819/ - command: ['/bin/bash', '-c', 'touch /var/log/horizon/horizon.log && chown -R apache:apache /var/log/horizon && chmod -R a+rx /etc/openstack-dashboard'] + command: ['/bin/bash', '-c', 'touch /var/log/horizon/horizon.log ; chown -R apache:apache /var/log/horizon && chmod -R a+rx /etc/openstack-dashboard'] volumes: - /var/log/containers/horizon:/var/log/horizon - /var/log/containers/httpd/horizon:/var/log/httpd