Fix keystone, cinder, heat-api cron containers
authorDan Prince <dprince@redhat.com>
Mon, 31 Jul 2017 21:49:24 +0000 (17:49 -0400)
committerDan Prince <dprince@redhat.com>
Tue, 1 Aug 2017 14:06:47 +0000 (10:06 -0400)
The cron containers need to run as root in order to create PID files
correctly.

Additionally, the keystone_cron container was misconfigured to
use /usr/bin/cron instead of the correct /usr/bin/crond.

Additionally we have an issue where the Kolla keystone container has
hard coded ARGS for the docker container which causes -DFOREGROUND
(an Apache specific argument) to get appended onto the kolla_start
command thus causing crond to fail to startup correctly. This
works around the issue by overriding the command and calling
kolla_set_configs manually. Once we fix this in Kolla we can
revisit this.

Change-Id: Ib8fb2bef9a3bb89131265051e9ea304525b58374
Related-bug: 1707785

docker/services/cinder-api.yaml
docker/services/heat-api.yaml
docker/services/keystone.yaml

index 7804fdb..f4ebdf6 100644 (file)
@@ -154,6 +154,7 @@ outputs:
           cinder_api_cron:
             image: *cinder_api_image
             net: host
+            user: root
             privileged: false
             restart: always
             volumes:
index 0bc331c..9e38b06 100644 (file)
@@ -133,6 +133,7 @@ outputs:
           heat_api_cron:
             image: {get_param: DockerHeatApiImage}
             net: host
+            user: root
             privileged: false
             restart: always
             volumes:
index 7ecfc32..8860338 100644 (file)
@@ -99,7 +99,9 @@ outputs:
               merge: true
               preserve_properties: true
         /var/lib/kolla/config_files/keystone_cron.json:
-          command: /usr/sbin/cron -n
+          # FIXME(dprince): this is unused ATM because Kolla hardcodes the
+          # args for the keystone container to -DFOREGROUND
+          command: /usr/sbin/crond -n
           config_files:
             - source: "/var/lib/kolla/config_files/src/*"
               dest: "/"
@@ -164,9 +166,11 @@ outputs:
           keystone_cron:
             start_order: 4
             image: *keystone_image
+            user: root
             net: host
             privileged: false
             restart: always
+            command: ['/bin/bash', '-c', '/usr/local/bin/kolla_set_configs && /usr/sbin/crond -n']
             volumes:
               list_concat:
                 - {get_attr: [ContainersCommon, volumes]}