Merge "Run proxysql with proxysql user"

This commit is contained in:
Zuul 2022-07-28 16:44:28 +00:00 committed by Gerrit Code Review
commit d7af870f81
3 changed files with 11 additions and 14 deletions

View File

@ -26,10 +26,16 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='proxysql') }}
{{ macros.install_packages(proxysql_packages | customizable("packages")) }}
COPY kolla_proxysql_start kolla_proxysql_config_sync kolla_extend_start /usr/local/bin/
RUN chmod 755 /usr/local/bin/kolla_proxysql_start \
&& chmod 755 /usr/local/bin/kolla_proxysql_config_sync \
COPY kolla_proxysql_config_sync kolla_extend_start /usr/local/bin/
RUN chmod 755 /usr/local/bin/kolla_proxysql_config_sync \
&& chmod 644 /usr/local/bin/kolla_extend_start
RUN install -g proxysql -o proxysql -m 770 -d /var/lib/kolla/proxysql \
&& touch /etc/proxysql.cnf \
&& chown proxysql:proxysql /etc/proxysql.cnf \
&& chmod 600 /etc/proxysql.cnf
{% block proxysql_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER proxysql

View File

@ -136,8 +136,8 @@ class ProxySQLConfig:
def write_config(self):
LOG.info("Writing config to {}".format(self.conf_file))
if os.path.exists(self.conf_file):
os.remove(self.conf_file)
with open(self.conf_file, 'wb') as f:
pass
for k, v in self.config.items():
if isinstance(v, dict):
self._write_dict(k, v)

View File

@ -1,9 +0,0 @@
#!/bin/bash
PROXYSQL_LOG_FILE="/var/log/kolla/proxysql/proxysql.log"
proxysql \
--exit-on-error \
--idle-threads \
--no-version-check \
-f -D /var/lib/proxysql -c /etc/proxysql.cnf >> ${PROXYSQL_LOG_FILE} 2>&1