-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for ntp server configuration from dhcp #158
Comments
We use https://github.com/NetworkConfiguration/dhcpcd inside of network system container this feature would need to be implemented in there. |
Actually it is there, but you have to provide a hook, see: https://github.com/NetworkConfiguration/dhcpcd/blob/master/hooks/50-ntp.conf |
Ah, but that is not enough because ntp client is running on different container. If you want to use custom NTP you need to configure those with cloud-init like this https://burmillaos.org/docs/configuration/advanced/write-files/#writing-files-in-specific-system-services |
Using cloud-init would make our deployment over complicated, because we have isolated networks, which all have their own ntp server. So I would need to create a cloud-init for each network and let our deployment pick the right cloud-init for the new host. Maybe for the future it makes sense to put the ntp client inside the network container, as this is also a network service, and would make it possible to distribute the ntp server by dhcp. |
What is purpose to use so overly complicated ntp server setup?
In general best practice is have just one process per containers so this would need process which can handle both dhcp client and ntp client. Anyway, if this is critical for you then perhaps you can try what happens when you enable Where dhcpcd will write that information about ntp servers and it ntp client able read it then? If you can proof that it works then perhaps we can fix it to v2.0.0 release version. Now when I'm looking there looks to be bug somewhere on build process anyway because on template config that option is actually already enabled: os/images/01-base/etc/dhcpcd.conf.tpl Lines 29 to 30 in 615b3d4
|
I have enabled $ sudo system-docker exec network dhcpcd -MA4 -U eth0 | grep ntp
ntp_servers=x.x.x.x So yes there is the dhcp provided ntp server. |
The dhcpcd template is only used when there are Lines 68 to 71 in 615b3d4
So dhcpcd configuration changes must go in the template and must be inline changed in the Dockerfile: Lines 36 to 37 in 615b3d4
And the inline change to remove the Maybe it is better to always use the template, regardless if |
Included to v2.0.0 |
@olljanat actually this is not working in v2 because you just implemented requesting ntp_servers from dhcp, but not the hook mentioned in #158 (comment) to update the |
I don't fully follow what is actually needed. Please, create pull request with valid logic. |
You need to place hook https://github.com/NetworkConfiguration/dhcpcd/blob/master/hooks/50-ntp.conf in the network container in |
Sadyl I'm not familiar with the build process, so I don't know what to do to get the new hook file in the network container. |
Those are part of base image defined in these files. Can be tested with normal Docker build + run https://github.com/burmilla/os/tree/master/images/01-base |
OK so this should works in way that So this would need bigger refactoring where So will close this one now... |
BurmillaOS Version: (ros os version)
v1.9.6
If you are using dhcp, it is quite common to also send a
ntp_servers
option (42) with the dhcp response.But currently the dhcpcd don't even request the
ntp_servers
option (it is commented out):It would be great if configuring ntp servers from dhcp could be implemented.
The text was updated successfully, but these errors were encountered: