[lldp]Fix lldp spawned after reboot when disabled (#11080)

- Why I did it
When LLDP is disabled through feature command, it gets spawned after reboot.

- How I did it
In syncd.sh check if the service is enabled before spawning automatically during cold reboot.

- How to verify it
Disable lldp feature. Perform cold reboot and verify its not spawned.
This commit is contained in:
Sudharsan Dhamal Gopalarathnam 2022-06-21 17:11:41 -07:00 committed by Judy Joseph
parent 8d72c484f8
commit 5188fdee0c

View File

@ -55,9 +55,13 @@ function waitplatform() {
if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]]; then
debug "LLDP service is delayed by a timer for better fast/warm boot performance"
else
debug "Starting lldp service..."
/bin/systemctl start lldp
debug "Started lldp service"
lldp_state=$(systemctl is-enabled lldp.timer)
if [[ $lldp_state == "enabled" ]]
then
debug "Starting lldp service..."
/bin/systemctl start lldp
debug "Started lldp service"
fi
fi
}