Hello,
I saw that recently a new timesync-https
service was added to handle updating the system time from an HTTPS service (e.g. in case NTP isn’t working). Here’s the pull request that added it: systemd/timeinit: add HTTPS time synchronisation service by markcorbinuk · Pull Request #2360 · balena-os/meta-balena · GitHub, and it appears that it landed in v2.88.0.
I was wondering if there was a way to trigger this service from my app code (e.g. by executing a bash script)? It would be great to be able to interact with this service on demand, and to check and see if it completed successfully.
The specific scenario I am trying to deal with is making sure that time has been synced before my app starts performing certain actions. Some of my fleet devices are on networks that block NTP, so I have written code to fall back to a manual time update in case NTP doesn’t work. I’d love to be able to check in with the timesync-https
service instead of doing my own work to update the system clock when NTP isn’t an option.
Thanks!