From 8437f6c9cd04aaf08d661e8ca5b49ad7767856b5 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Fri, 26 Apr 2019 16:41:10 +0200 Subject: [PATCH] ensure /var/run/redis is present upon reboot /var/run is mounted as a tmpfs, which means /var/run/redis disappears on reboot. Since podman doesn't try to recreate a directory if it doesn't exist, containerized redis cannot be restarted because one of its bind mount is missing. Force the creation of /var/run/redis after every reboot, with default permissions. On container restart, Kolla will chown and chmod the directory to the proper value. Change-Id: I36c81f58c3b3e9366212a93f73b6212cca4ea569 Closes-Bug: #1826554 Depends-On: Iaa8a99eb9ced21fb6c7c87c5b56dec55383af9a9 (cherry picked from commit 75361e66b0357f9997586bd6581f0abc05f2cc96) --- deployment/database/redis-container-puppet.yaml | 5 +++++ deployment/database/redis-pacemaker-puppet.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/deployment/database/redis-container-puppet.yaml b/deployment/database/redis-container-puppet.yaml index 7a9f4a0ee2..cd7be78209 100644 --- a/deployment/database/redis-container-puppet.yaml +++ b/deployment/database/redis-container-puppet.yaml @@ -222,6 +222,11 @@ outputs: - { 'path': /var/log/containers/redis, 'setype': svirt_sandbox_file_t } - { 'path': /var/run/redis, 'setype': svirt_sandbox_file_t } - { 'path': /var/log/redis, 'setype': svirt_sandbox_file_t } + - name: ensure /var/run/redis is present upon reboot + copy: + dest: /etc/tmpfiles.d/var-run-redis.conf + content: | + d /var/run/redis 0755 root root - - - name: redis logs readme copy: dest: /var/log/redis/readme.txt diff --git a/deployment/database/redis-pacemaker-puppet.yaml b/deployment/database/redis-pacemaker-puppet.yaml index f92d908499..3a96d7a681 100644 --- a/deployment/database/redis-pacemaker-puppet.yaml +++ b/deployment/database/redis-pacemaker-puppet.yaml @@ -294,6 +294,11 @@ outputs: - { 'path': /var/log/containers/redis, 'setype': svirt_sandbox_file_t } - { 'path': /var/run/redis, 'setype': svirt_sandbox_file_t } - { 'path': /var/log/redis, 'setype': svirt_sandbox_file_t } + - name: ensure /var/run/redis is present upon reboot + copy: + dest: /etc/tmpfiles.d/var-run-redis.conf + content: | + d /var/run/redis 0755 root root - - - name: redis logs readme copy: dest: /var/log/redis/readme.txt