Skip to content

Commit

Permalink
[Mellanox] [pmon] Fix for PMON service not starting when restarting S…
Browse files Browse the repository at this point in the history
…WSS service after fast/warm reboot (#10901)

- 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.

Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
  • Loading branch information
shlomibitton authored and yxieca committed Jun 17, 2022
1 parent 8a76cdc commit 323aa79
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 @@ -48,7 +48,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 323aa79

Please sign in to comment.