Restart chrony/ntp service on interfaces-config restart#69
Open
anamehra wants to merge 1 commit intosonic-net:masterfrom
Open
Restart chrony/ntp service on interfaces-config restart#69anamehra wants to merge 1 commit intosonic-net:masterfrom
anamehra wants to merge 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: Anand Mehra (anamehra) <anamehra@cisco.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restart NTP service when interfaces-config restarts
Problem
When ZTP restarts the
interfaces-configservice (during link scan or periodic restarts), it causes issues with the NTP service if management VRF is configured.Why this happens:
interfaces-configchanges the network namespace and VRF configurationSolution
Added logic to detect which NTP service is running (chrony or ntp) and restart it around the
interfaces-configrestart:This ensures NTP continues working correctly in the management VRF after network reconfigurations.
Changes
get_ntp_service_name()function to detect which service is available, and__restart_network_services()method to handle the restart sequenceget_ntp_service()function and updated install/remove sections to stop/start NTP around interfaces-config restartsWhy detect the service?
Different SONiC releases use different NTP implementations (ntp vs chrony), so we check which one is actually running instead of hardcoding it. The code checks in priority order: chrony first, then ntp.