[Mellanox] [pmon] Fix for PMON service not starting when restarting SWSS 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>
This commit is contained in:
shlomibitton 2022-06-16 12:15:09 +03:00 committed by GitHub
parent b6811a58cf
commit 1474ad76d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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