Set owner and group of redis_chassis to redis

Signed-off-by: Venkat Garigipati <venkatg@cisco.com>
This commit is contained in:
Venkat Garigipati 2024-03-21 16:51:12 -07:00
parent 4ee6b6e8b5
commit fd4fcb9496

View File

@ -59,6 +59,8 @@ db_cfg_file_tmp="/var/run/redis/sonic-db/database_config.json.tmp"
cp $db_cfg_file $db_cfg_file_tmp
if [[ $DATABASE_TYPE == "chassisdb" ]]; then
REDIS_CHASSIS_DIR=/var/run/redis-chassis
REDIS_CHASSIS_LIB_DIR=/var/lib/redis_chassis
# Docker init for database-chassis
echo "Init docker-database-chassis..."
update_chassisdb_config -j $db_cfg_file_tmp -k -p $chassis_db_port
@ -66,6 +68,9 @@ if [[ $DATABASE_TYPE == "chassisdb" ]]; then
sonic-cfggen -j $db_cfg_file_tmp \
-t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \
-t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes
echo "Create directories and set ownership recursively..."
mkdir -p $REDIS_CHASSIS_DIR/sonic-db $REDIS_CHASSIS_LIB_DIR
chown -R redis:redis $REDIS_CHASSIS_DIR $REDIS_CHASSIS_LIB_DIR
rm $db_cfg_file_tmp
exec /usr/local/bin/supervisord
exit 0