Skip to content

Commit 09026ed

Browse files
[warm-reboot] fix warm-reboot when /tmp/cache is missing (sonic-net#2367)
- What I did Fixed issue when cache wasn't generated and warm reboot command fails. Fixes sonic-net#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 a3c404c commit 09026ed

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
@@ -466,10 +466,13 @@ function save_counters_folder() {
466466
debug "Saving counters folder before warmboot..."
467467
468468
counters_folder="/host/counters"
469+
counters_cache="/tmp/cache"
469470
if [[ ! -d $counters_folder ]]; then
470471
mkdir $counters_folder
471472
fi
472-
cp -rf /tmp/cache $counters_folder
473+
if [[ -d $counters_cache ]]; then
474+
cp -rf $counters_cache $counters_folder
475+
fi
473476
fi
474477
}
475478

0 commit comments

Comments
 (0)