Skip to content

Commit

Permalink
[scripts/fast-reboot] stop timers in advance (sonic-net#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 and qiluo-msft committed Apr 13, 2022
1 parent 00ef80e commit fa07373
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 @@ -599,6 +599,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
# Kill nat docker after saving the conntrack table
debug "Stopping nat ..."
Expand Down

0 comments on commit fa07373

Please sign in to comment.