Skip to content
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

nixos: fix #48917 by setting SYSTEMD_TIMEDATED_NTP_SERVICES #48919

Merged
merged 1 commit into from Nov 2, 2018

Conversation

thoughtpolice
Copy link
Member

@thoughtpolice thoughtpolice commented Oct 23, 2018

Setting this variable in the environment of systemd-timedated allows
'timedatectl' to tell if an NTP service is running.

Closes #48917.

Motivation for this change
Things done

@peterhoeg
Copy link
Member

I don't this is necessary for systemd-timesyncd:

peter@mildred:~ $ timedatectl
               Local time: Wed 2018-10-24 12:58:01 +08
           Universal time: Wed 2018-10-24 04:58:01 UTC
                 RTC time: Wed 2018-10-24 04:58:01
                Time zone: Asia/Singapore (+08, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

This is just with services.timesyncd.enable = true; and no other modifications.

@c0bw3b
Copy link
Contributor

c0bw3b commented Oct 29, 2018

@thoughtpolice what happens if you more than one NTP daemon other than timesyncd running? Is timedatectl still able to guess NTP service status?
I know it would be a setup that doesn't make much sense, but I'm curious

@peterhoeg seems the original issue mentions a problem when using another NTP daemon such as ntpd or chronyd and not using timesyncd

@peterhoeg
Copy link
Member

seems the original issue mentions a problem when using another NTP daemon such as ntpd or chronyd and not using timesyncd

Correct @COBWEB, but this PR sets the variable for timesyncd too.

@thoughtpolice
Copy link
Member Author

@c0bw3b The semantics of SYSTEMD_TIMEDATED_NTP_SERVICES are that it is actually a colon-separated list of service names, each of represents an NTP service, and returns true if any of those services are running. Therefore, the normal setup is something like

SYSTEMD_TIMEDATED_NTP_SERVICES=ntpd.service:chronyd.service:systemd-timesyncd.service

And timedatectl just looks to find and ensure one of these is active.

In our case the NixOS modules for various services are exclusive; enabling multiple ones will probably have weird results because they use mkForce false to disable other daemons.

Setting this variable in the environment of systemd-timedated allows
'timedatectl' to tell if an NTP service is running.

Closes NixOS#48917.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
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.

None yet

4 participants