Skip to content

Commit

Permalink
[202012] [Mellanox] [pmon] Fix for PMON service not starting when res…
Browse files Browse the repository at this point in the history
…tarting SWSS service after fast/warm reboot (#10902)

- Why I did it
Recent change to delay PMON service in case of fast/warm reboot introduce an issue when restarting only SWSS service after fast/warm reboot for Nvidia platform.
Since the timer is triggered only when the system boot, in a scenario when the system is after a fast/warm reboot and the user restart SWSS service, as part of syncd.sh script, PMON service will stop but the timer will not start again.

- How I did it
On syncd.sh script, in case of fast/warm indication, check if pmon.timer is running.
If it is running it means we are at the first boot and continue normally.
If it is not running, meaning the service was restarted, start the timer to keep the system behavior consistent.

- How to verify it
Run fast/warm reboot.
service swss restart.
Observe PMON service starting.
  • Loading branch information
shlomibitton authored Jun 8, 2022
1 parent 27cd735 commit 2a9aa08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ function waitplatform() {
BOOT_TYPE=`getBootType`
if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then
if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]]; then
debug "PMON service is delayed by a timer for better fast/warm boot performance"
PMON_TIMER_STATUS=$(systemctl is-active pmon.timer)
if [[ x"$PMON_TIMER_STATUS" = x"inactive" ]]; then
systemctl start pmon.timer
else
debug "PMON service is delayed by a timer for better fast/warm boot performance"
fi
else
debug "Starting pmon service..."
/bin/systemctl start pmon
Expand Down

0 comments on commit 2a9aa08

Please sign in to comment.