Skip to content

Add support for NTP configuration via DHCP (fixes #689)#1798

Merged
agners merged 2 commits intohome-assistant:devfrom
redgryphon:support-ntp-via-dhcp
Mar 20, 2022
Merged

Add support for NTP configuration via DHCP (fixes #689)#1798
agners merged 2 commits intohome-assistant:devfrom
redgryphon:support-ntp-via-dhcp

Conversation

@redgryphon
Copy link
Contributor

I managed to create a working solution that fixes #689. It works in my lab but I think it is pretty straightforward to be understood and to be reproduced as well.

@homeassistant
Copy link

Hi @redgryphon,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copy link
Member

@agners agners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd like to have also an option to set the NTP server from the user interface (Supervisor). However, for that systemd-temesyncd would need a D-Bus property to set the NTP server via D-Bus. That is currently not available 😞

However, this is independent, and for now we can set NTP server via config file as your PR suggests.

@redgryphon
Copy link
Contributor Author

Ideally we'd like to have also an option to set the NTP server from the user interface (Supervisor).

Oh, that would be the end goal for everyone I suppose.

However, for that systemd-temesyncd would need a D-Bus property to set the NTP server via D-Bus. That is currently not available 😞

Is it because there is something to be done in Home Assistant or because systemd-timesyncd lacks the support for it?

@agners
Copy link
Member

agners commented Mar 17, 2022

Is it because there is something to be done in Home Assistant or because systemd-timesyncd lacks the support for it?

Because systemd-timesyncd lacks the support for it.

It has already a D-Bus interface, so I think it should be fairly straight forward to add it.

@redgryphon
Copy link
Contributor Author

Because systemd-timesyncd lacks the support for it.

It has already a D-Bus interface, so I think it should be fairly straight forward to add it.

If I ever got time in the near future that could be something I'd like to tinker with. We'll see.

@nagyrobi
Copy link

nagyrobi commented Apr 8, 2022

This has been merged in the latest beta - question is, how can we check what's the currently active NTP server set in the system?

@agners
Copy link
Member

agners commented Apr 11, 2022

There is no built-in way in Supervisor or CLI to get the NTP server, currently. Similar to editing NTP server it would need D-Bus support (see #1798 (review)).

If you have enabled SSH access to the OS, you can check the logs to see what server has been used (using journalctl -u systemd-timesyncd).

@redgryphon
Copy link
Contributor Author

This has been merged in the latest beta - question is, how can we check what's the currently active NTP server set in the system?

If I'll find some time I am able to create another PR for this information to be available at least in the CLI.

agners added a commit to agners/operating-system that referenced this pull request May 19, 2022
agners added a commit that referenced this pull request May 19, 2022
* Make NTP dispatch script executable (#1798)

* Address shellcheck issues
agners added a commit that referenced this pull request May 19, 2022
* Make NTP dispatch script executable (#1798)

* Address shellcheck issues
agners added a commit to agners/operating-system that referenced this pull request Aug 10, 2022
agners added a commit to agners/operating-system that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DHCP-provided NTP not used

4 participants