Skip to content

Commit

Permalink
Remove timer from FAST_REBOOT STATE_DB entry and use finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
arfeigin committed Jan 23, 2023
1 parent fba87f4 commit 03c81f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function clear_boot()
#clear_fast_boot
if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
sonic-db-cli STATE_DB DEL "FAST_REBOOT|system" &>/dev/null || /bin/true
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "disable" &>/dev/null || /bin/true
fi
}
Expand Down Expand Up @@ -532,7 +532,7 @@ case "$REBOOT_TYPE" in
check_warm_restart_in_progress
BOOT_TYPE_ARG=$REBOOT_TYPE
trap clear_boot EXIT HUP INT QUIT TERM KILL ABRT ALRM
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "1" "EX" "210" &>/dev/null
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "enable" &>/dev/null
config warm_restart enable system
;;
"warm-reboot")
Expand Down
3 changes: 2 additions & 1 deletion sonic-utilities-data/templates/service_mgmt.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function check_warm_boot()

function check_fast_boot()
{
if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then
SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB GET "FAST_REBOOT|system"`
if [[ ${SYSTEM_FAST_REBOOT} == "enable" ]]; then
FAST_BOOT="true"
else
FAST_BOOT="false"
Expand Down

0 comments on commit 03c81f1

Please sign in to comment.