-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NTP] Add NTP extended configuration #15058
Conversation
ac7c66f
to
235778b
Compare
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Pull request contains merge conflicts. |
235778b
to
f06adf4
Compare
The test failed because the code sonic-net/sonic-host-services#60 should be merged. |
@@ -27,21 +28,29 @@ fi | |||
|
|||
( | |||
flock -w 180 9 | |||
ntpEnabled=$(/usr/local/bin/sonic-cfggen -d -v 'NTP["global"]["admin_state"]' 2> /dev/null) | |||
if [ "$ntpEnabled" = "disabled" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can ExecCondition=
in the systemd service file be used to check this condition instead? That way the service status will accurately reflect that a condition check failed.
There also shoudn't be another ntp daemon running at this point of time, so there shouldn't be anything that needs to be stopped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. nice idea, I guess it will work. I will try it and let you know the result here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any update here on whether this worked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey. I tried it with another daemon and it actually works fine. I tried to rework it here, but it won't work here in a couple of reasons:
- It is not a one-line solution and will basically make this implementation more complex.
- We are using lock here, which will be much harder to use in the service file.
- We need to use
ExecStopPost
condition to stop the daemon.
Other reasons I don't like this option:
- We need to modify ntp service file which is controlled by open source community and not modified by us.
- That
ntp-systemd-wrapper
script was created exactly to customize the control of ntp daemon.
So I would like to avoid of such changes
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
…access for other. Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
f06adf4
to
2cbcae9
Compare
+@ganglyu to review SONiC Yang model |
@@ -68,6 +105,9 @@ module sonic-ntp { | |||
type leafref { | |||
path /mprt:sonic-mgmt_port/mprt:MGMT_PORT/mprt:MGMT_PORT_LIST/mprt:name; | |||
} | |||
type string { | |||
pattern 'eth0'; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this type?
I think eth0 is the management port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, eth0
will be covered by MGMT_PORT
, but if it is undefined in MGMT_PORT
(which is possible, at first boot, for example) it will fail during build, because it checks for init_cfg conforms YANG model. So my logic here: src_intf
is either port from MGMT_PORT, or eth0, or port from other leafref.
would you please update src/sonic-yang-models/tests/files/sample_config_db.json? |
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
updated |
@qiluo-msft all comments resolved. Can we proceed with that? |
In sonic-net#15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. To restore the old behavior, when loading from minigraph, add `"iburst": "true"` for each NTP server loaded from minigraph. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
Why I did it In #15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. Fixes #19425. How I did it To restore the old behavior, when loading from minigraph, add "iburst": "true" for each NTP server loaded from minigraph. How to verify it Tested on a KVM setup, verified that the generated ntp.conf file had the iburst option. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
…#19424) Why I did it In sonic-net#15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. Fixes sonic-net#19425. How I did it To restore the old behavior, when loading from minigraph, add "iburst": "true" for each NTP server loaded from minigraph. How to verify it Tested on a KVM setup, verified that the generated ntp.conf file had the iburst option. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
…#19424) Why I did it In sonic-net#15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. Fixes sonic-net#19425. How I did it To restore the old behavior, when loading from minigraph, add "iburst": "true" for each NTP server loaded from minigraph. How to verify it Tested on a KVM setup, verified that the generated ntp.conf file had the iburst option. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
…19741) Why I did it In #15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. Fixes #19425. How I did it To restore the old behavior, when loading from minigraph, add "iburst": "true" for each NTP server loaded from minigraph. How to verify it Tested on a KVM setup, verified that the generated ntp.conf file had the iburst option. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
…#19424) Why I did it In sonic-net#15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. Fixes sonic-net#19425. How I did it To restore the old behavior, when loading from minigraph, add "iburst": "true" for each NTP server loaded from minigraph. How to verify it Tested on a KVM setup, verified that the generated ntp.conf file had the iburst option. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
Why I did it In #15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. Fixes #19425. How I did it To restore the old behavior, when loading from minigraph, add "iburst": "true" for each NTP server loaded from minigraph. How to verify it Tested on a KVM setup, verified that the generated ntp.conf file had the iburst option. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
…#19424) Why I did it In sonic-net#15058, the NTP server configuration was modified to add additional options, such as conditionally enabling iburst, specifying the association type, and specifying the NTP version. One side effect of this was that the iburst option which was previously always enabled now requires it to be explicitly enabled in the config_db. Fixes sonic-net#19425. How I did it To restore the old behavior, when loading from minigraph, add "iburst": "true" for each NTP server loaded from minigraph. How to verify it Tested on a KVM setup, verified that the generated ntp.conf file had the iburst option. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
hld #1296
closes #1254
depends-on #60, #781, #2835, #10749
Why I did it
To cover the next AIs:
Work item tracking
How I did it
How to verify it
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
NTP configuration
A picture of a cute animal (it is my cat Finn)