From a79dd716c40699081519db8a7ad2248e9c4d5e41 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Mon, 15 Jul 2019 20:21:02 -0700 Subject: [PATCH] [database] save configuration after DB migration (#3143) - Make sure that migrated DB contents persisted for next boot - Make sure that db saved after warm reboot. Signed-off-by: Ying Xie --- files/build_templates/docker_image_ctl.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 426e519f1e..2d35598de9 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -63,6 +63,11 @@ function postStartAction() if [[ -x /usr/bin/db_migrator.py ]]; then # Migrate the DB to the latest schema version if needed /usr/bin/db_migrator.py -o migrate + + # Save in memory config_db to config_db.json for 2 reasons: + # 1. Persist the DB migration result. + # 2. Save in memory DB after warm reboot. + /usr/bin/config save -y fi {%- elif docker_container_name == "swss" %} docker exec swss rm -f /ready # remove cruft