From 33a04123707d75e3a78253f8c46ef50f6afa8018 Mon Sep 17 00:00:00 2001 From: malletvapid23 Date: Mon, 19 Sep 2022 09:31:00 +0300 Subject: [PATCH] [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 --- scripts/fast-reboot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index ac96726..d7c291b 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -466,10 +466,13 @@ function save_counters_folder() { debug "Saving counters folder before warmboot..." counters_folder="/host/counters" + counters_cache="/tmp/cache" if [[ ! -d $counters_folder ]]; then mkdir $counters_folder fi - cp -rf /tmp/cache $counters_folder + if [[ -d $counters_cache ]]; then + cp -rf $counters_cache $counters_folder + fi fi }