From 12eb20a61b008efc3b7834f5f628df2fa95c7276 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Wed, 10 Apr 2024 14:49:31 +0700 Subject: [PATCH] fix Bug 65410 - Disable ds:metrics service when METRICS_ENABLED=false (#726) --- config/supervisor/ds/ds-metrics.conf | 4 ++-- run-document-server.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/supervisor/ds/ds-metrics.conf b/config/supervisor/ds/ds-metrics.conf index 1eb858a23..d9c7576cb 100644 --- a/config/supervisor/ds/ds-metrics.conf +++ b/config/supervisor/ds/ds-metrics.conf @@ -9,5 +9,5 @@ stdout_logfile_maxbytes=0 stderr_logfile=/var/log/COMPANY_NAME/documentserver/metrics/err.log stderr_logfile_backups=0 stderr_logfile_maxbytes=0 -autostart=true -autorestart=true +autostart=false +autorestart=false diff --git a/run-document-server.sh b/run-document-server.sh index b161b409b..573361963 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -23,6 +23,7 @@ DS_LOG_DIR="${LOG_DIR}/documentserver" LIB_DIR="/var/lib/${COMPANY_NAME}" DS_LIB_DIR="${LIB_DIR}/documentserver" CONF_DIR="/etc/${COMPANY_NAME}/documentserver" +SUPERVISOR_CONF_DIR="/etc/supervisor/conf.d" IS_UPGRADE="false" ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false} @@ -275,6 +276,7 @@ update_statsd_settings(){ ${JSON} -I -e "this.statsd.host = '${METRICS_HOST}'" ${JSON} -I -e "this.statsd.port = '${METRICS_PORT}'" ${JSON} -I -e "this.statsd.prefix = '${METRICS_PREFIX}'" + sed -i -E "s/(autostart|autorestart)=.*$/\1=${METRICS_ENABLED}/g" ${SUPERVISOR_CONF_DIR}/ds-metrics.conf } update_db_settings(){