Remove ifupdown hooks installed by Chrony#27549
Open
saiarcot895 wants to merge 1 commit into
Open
Conversation
Chrony installs ifupdown hooks to automatically mark NTP servers as either online or offline, depending on network connectivity. This can cause problems in SONiC, since there are interfaces dynamically created and don't get triggered via any network hooks. Remove the ifupdown hooks so that Chrony always treats the NTP servers as online. Note that there are other hooks installed (ppp, NetworkManager) that haven't been removed only because SONiC doesn't use these. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Debian rootfs extension script to remove Chrony’s ifupdown hook scripts during image build, preventing Chrony from marking NTP sources online/offline based on ifupdown events (which can be problematic with SONiC’s dynamically created interfaces).
Changes:
- Add a build-time step to delete Chrony’s ifupdown hook scripts from the target filesystem.
- Keep Chrony enabled with SONiC’s systemd override as before.
| sudo cp $IMAGE_CONFIGS/chrony/override.conf $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/chrony.service.d/ | ||
| sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable chrony.service | ||
| # Remove Chrony's hooks into ifupdown system, so that NTP sources are always treated as online | ||
| sudo rm $FILESYSTEM_ROOT/etc/network/if-post-down.d/chrony $FILESYSTEM_ROOT/etc/network/if-up.d/chrony |
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.
Why I did it
Chrony installs ifupdown hooks to automatically mark NTP servers as either online or offline, depending on network connectivity. This can cause problems in SONiC, since there are interfaces dynamically created and don't get triggered via any network hooks.
Work item tracking
How I did it
Remove the ifupdown hooks so that Chrony always treats the NTP servers as online. Note that there are other hooks installed (ppp, NetworkManager) that haven't been removed only because SONiC doesn't use these.
How to verify it
Loaded the image on KVM, verified that the hooks weren't present in
/etc/network/if-up.dand/etc/network/if-post-down.d, then shut down BGP and eth0, and verified thatchronyc -n activitysaid that 2 sources were online. Without this change, it said the sources went offline.Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)