[chassis] Fixed critical process not correct for database-chassis docker (#13445) (#13486)

This commit is contained in:
mssonicbld 2023-01-24 04:35:55 +08:00 committed by GitHub
parent 4600929f96
commit 74a7d2d751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -37,12 +37,12 @@ RUN apt-get clean -y && \
' /etc/redis/redis.conf
COPY ["supervisord.conf.j2", "/usr/share/sonic/templates/"]
COPY ["critical_processes.j2", "/usr/share/sonic/templates/"]
COPY ["docker-database-init.sh", "/usr/local/bin/"]
COPY ["database_config.json.j2", "/usr/share/sonic/templates/"]
COPY ["database_global.json.j2", "/usr/share/sonic/templates/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["files/sysctl-net.conf", "/etc/sysctl.d/"]
COPY ["critical_processes", "/etc/supervisor"]
COPY ["files/update_chassisdb_config", "/usr/local/bin/"]
COPY ["flush_unused_database", "/usr/local/bin/"]

View File

@ -1 +0,0 @@
program:redis

View File

@ -0,0 +1,5 @@
{% if INSTANCES %}
{% for redis_inst, redis_items in INSTANCES.items() %}
program:{{ redis_inst }}
{%- endfor %}
{%- endif %}

View File

@ -52,6 +52,7 @@ if [[ $DATABASE_TYPE == "chassisdb" ]]; then
update_chassisdb_config -j $db_cfg_file_tmp -k -p $chassis_db_port
# generate all redis server supervisord configuration file
sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/critical_processes.j2 > /etc/supervisor/critical_processes
rm $db_cfg_file_tmp
exec /usr/local/bin/supervisord
exit 0
@ -69,6 +70,7 @@ fi
# delete chassisdb config to generate supervisord config
update_chassisdb_config -j $db_cfg_file_tmp -d
sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/critical_processes.j2 > /etc/supervisor/critical_processes
if [[ "$start_chassis_db" != "1" ]] && [[ -z "$chassis_db_address" ]]; then
cp $db_cfg_file_tmp $db_cfg_file