Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,14 @@ function postStartAction()
fi
fi

if [ -e /tmp/pending_config_migration ] || [ -e /tmp/pending_config_initialization ]; then
# this is first boot to a new image, config-setup execution is pending.
# for warmboot case, DB is loaded but migration is still pending
# For firstbboot/fast/cold reboot case, DB contains nothing at this point
# unset CONFIG_DB_INITIALIZED to indicate pending config load and migration
# This flag will be set to "1" after DB migration/initialization is completed as part of config-setup
$SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "0"
else
# set CONFIG_DB_INITIALIZED to indicate end of config load and migration
$SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
fi
# First boot to a new image: config-setup execution is pending.
# Warmboot: DB is loaded but migration is still pending
# firstbboot/fast/cold reboot: DB contains nothing at this point
# successive reboot: DB might contain a custom config_db json. Migration pending
# unset CONFIG_DB_INITIALIZED to indicate pending config load and/or migration
# This flag will be set to "1" after DB migration/initialization is completed as part of config-setup
$SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "0"

# Add redis UDS to the redis group and give read/write access to the group
REDIS_SOCK="/var/run/redis${DEV}/redis.sock"
else
Expand Down
4 changes: 4 additions & 0 deletions files/image_config/config-setup/config-setup
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ boot_config()
check_system_warm_boot
if [ -e /tmp/pending_config_migration ] || [ -e ${CONFIG_SETUP_POST_MIGRATION_FLAG} ]; then
do_config_migration
else
do_db_migration
fi

# For multi-npu platfrom we don't support config initialization. Assumption
Expand All @@ -434,6 +436,8 @@ boot_config()

if [ -e /tmp/pending_config_initialization ] || [ -e ${CONFIG_SETUP_INITIALIZATION_FLAG} ]; then
do_config_initialization
else
do_db_migration
fi

# If no startup configuration is found, create a configuration to be used
Expand Down