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

This commit is contained in:
mssonicbld 2023-02-13 01:22:50 +08:00 committed by GitHub
parent 3e619d4385
commit b3cf657129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -36,12 +36,12 @@ RUN apt-get clean -y && \
' /etc/redis/redis.conf ' /etc/redis/redis.conf
COPY ["supervisord.conf.j2", "/usr/share/sonic/templates/"] 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 ["docker-database-init.sh", "/usr/local/bin/"]
COPY ["database_config.json.j2", "/usr/share/sonic/templates/"] COPY ["database_config.json.j2", "/usr/share/sonic/templates/"]
COPY ["database_global.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/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["files/sysctl-net.conf", "/etc/sysctl.d/"] COPY ["files/sysctl-net.conf", "/etc/sysctl.d/"]
COPY ["critical_processes", "/etc/supervisor"]
COPY ["files/update_chassisdb_config", "/usr/local/bin/"] COPY ["files/update_chassisdb_config", "/usr/local/bin/"]
COPY ["flush_unused_database", "/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 update_chassisdb_config -j $db_cfg_file_tmp -k -p $chassis_db_port
# generate all redis server supervisord configuration file # 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/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 rm $db_cfg_file_tmp
exec /usr/local/bin/supervisord exec /usr/local/bin/supervisord
exit 0 exit 0
@ -69,6 +70,7 @@ fi
# delete chassisdb config to generate supervisord config # delete chassisdb config to generate supervisord config
update_chassisdb_config -j $db_cfg_file_tmp -d 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/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 if [[ "$start_chassis_db" != "1" ]] && [[ -z "$chassis_db_address" ]]; then
cp $db_cfg_file_tmp $db_cfg_file cp $db_cfg_file_tmp $db_cfg_file