Skip to content

Commit 93f1d74

Browse files
stepanblyschakyxieca
authored andcommitted
[warm-reboot] fix warm-reboot when /tmp/cache is missing (#2367)
- What I did Fixed issue when cache wasn't generated and warm reboot command fails. Fixes sonic-net/sonic-buildimage#11914 - How I did it Added a check for cache existence - How to verify it Run warm-reboot Signed-off-by: Stepan Blyschak <[email protected]>
1 parent 3293866 commit 93f1d74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/fast-reboot

+4-1
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,13 @@ function save_counters_folder() {
454454
if [[ "$REBOOT_TYPE" = "warm-reboot" ]]; then
455455
debug "Saving counters folder before warmboot..."
456456
counters_folder="/host/counters"
457+
counters_cache="/tmp/cache"
457458
if [[ ! -d $counters_folder ]]; then
458459
mkdir $counters_folder
459460
fi
460-
cp -rf /tmp/cache $counters_folder
461+
if [[ -d $counters_cache ]]; then
462+
cp -rf $counters_cache $counters_folder
463+
fi
461464
fi
462465
}
463466

0 commit comments

Comments
 (0)