From 5b18d6e98bd65e1e24334590d479a0fb9243ebfc Mon Sep 17 00:00:00 2001 From: dawnbeauty <18810562248@163.com> Date: Fri, 10 Jan 2020 16:17:34 +0800 Subject: [PATCH] [fast-reboot] save fast-reboot state into the db Fixes Azure/sonic-buildimage#4006 1. save fast-reboot state into the db(aligned with Azure/sonic-buildimage#3741) 2. `sonic-buildimage/files/scripts/syncd.sh` could detect the FAST reboot type by the saved fast-reboot state, and request syncd to fast shutdown. --- scripts/fast-reboot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index c331407717..cd37932a56 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -96,6 +96,8 @@ function clear_fast_boot() { debug "${REBOOT_TYPE} failure ($?) cleanup ..." + /usr/bin/redis-cli -n 6 del "FAST_REBOOT|system" > /dev/null || /bin/true + /sbin/kexec -u || /bin/true teardown_control_plane_assistant @@ -307,6 +309,7 @@ BOOT_TYPE_ARG="cold" case "$REBOOT_TYPE" in "fast-reboot") BOOT_TYPE_ARG=$REBOOT_TYPE + /usr/bin/redis-cli -n 6 set "FAST_REBOOT|system" "1" > /dev/null trap clear_fast_boot EXIT HUP INT QUIT TERM KILL ABRT ALRM ;; "warm-reboot")