-
Notifications
You must be signed in to change notification settings - Fork 339
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
[Snap] Implement NTP API #3161
Comments
timeserver-control probably covers precisely what you need; it may be worth investigating if time-control and timezone-control may also be relevant. There's also the ptp interface, with an example implementation. If timeserver-control suffices, Ogra actually has a simple implementation example here which should still hold just fine. |
@dilyn-corner As I understand it, what @ogra1's tool does is allow the user to set and unset an NTP server endpoint. Looking more closely at the Raspbian back end for WebThings Gateway I see that it does two things:
I believe the reason these two functions exist are that during first time setup it's important the system clock is set correctly in order to avoid errors during the process of issuing a TLS certificate from LetsEncrypt for a new unique subdomain and then redirecting to that subdomain. This is particularly important on a Raspberry Pi which lacks a real-time clock. During first time setup the gateway will display a warning to the user if it detects that the system clock is not synchronised. It will then attempt to restart the NTP service and poll the gateway for a synchronised status before removing the warning. Am I right to assume that an NTP server is set on Ubuntu Core by default? If so then what we need is a bit different to what @ogra1's tool provides. Rather than set an NTP service endpoint, we need to be able to query the synchronisation status of the NTP service, and potentially restart the NTP service if necessary. @dilyn-corner / @ogra1 Is this possible to do by connecting the |
The timeserver-control interface gives you full access to the timedatectl command but it does indeed not open a path to call |
Implement a mechanism by which the gateway can check the status of an NTP server and restart it.
This is used by the gateway to check whether the clock has been set from the internet, in order to warn the user about potential certificate validation problems if the system clock is wrong.
E.g. https://github.com/WebThingsIO/gateway/blob/master/src/platforms/linux-raspbian.ts#L976
The text was updated successfully, but these errors were encountered: