Skip to content

Commit

Permalink
[scripts/fast-reboot] stop timers in advance (#2131)
Browse files Browse the repository at this point in the history
- What I did
Service timers may trigger service start in the middle of warm-reboot. Stopping them in advance prevents this issue.

- How I did it
Stopped all service timers that are part of sonic-delayed.target

- How to verify it
Run warm-reboot.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak authored Apr 12, 2022
1 parent 4dad79c commit 576c9ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,13 @@ if [ -x ${LOG_SSD_HEALTH} ]; then
${LOG_SSD_HEALTH}
fi
# Stop any timers to prevent any containers starting in the middle of the process.
TIMERS=$(systemctl list-dependencies --plain sonic-delayed.target | sed 1d)
for timer in ${TIMERS}; do
debug "Stopping ${timer} ..."
systemctl stop ${timer}
debug "Stopped ${timer} ..."
done
if [[ -f ${SHUTDOWN_ORDER_FILE} ]]; then
SERVICES_TO_STOP="$(cat ${SHUTDOWN_ORDER_FILE})"
Expand Down

0 comments on commit 576c9ef

Please sign in to comment.