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

Document that timedatectl set-ntp == systemctl {enable/disable} systemd-timesyncd.service #798

Closed
wlcrls47 opened this issue Jul 31, 2015 · 5 comments

Comments

@wlcrls47
Copy link

I'm confused by the documentation, on whether timedatectl set-ntp ONLY enables or disables systemd-timesyncd.service, or if it does this AND other things. Are they interchangeable? I'm betting they aren't interchangeable, because the other systemd services don't have a non-systemctl way to be enabled/disabled (as far as I've ran into.)

Asking, because "timedatectl set-ntp true" fails from the boot cd in arch-chroot with "Failed to create bus connection: No such file or directory". But, systemctl runs without needing a bus connection.

@falconindy
Copy link
Contributor

systemctl runs without a bus connection because it has fallback logic to enable/disable units in the absence of a usable bus connection. timedatectl defers work to timedated by communicating with it over the bus. So, it makes sense that systemctl works and timedatectl fails in the absence of a system bus. This situation ought to improve once kdbus is around.

Looking at the code, calling timedatectl set-ntp true is equivalent to calling systemctl --now enable systemd-timedated. Similarly, timedatectl set-ntp false is equivalent to calling systemctl --now disable systemd-timedated.

@poettering
Copy link
Member

It only controls systemd-timesyncd.service.

Today the setting is pretty redundant since "systemctl enable systemd-timesyncd.service" is also hooked up to PolicyKit, and thus clients such as GNOME could just invoke that directly.

@poettering
Copy link
Member

We should probably update the man page to explain in more detail what this does.

@poettering poettering changed the title Clarification on if timedatectl set-ntp == systemctl {enable/disable} systemd-timesyncd.service Document that timedatectl set-ntp == systemctl {enable/disable} systemd-timesyncd.service Jul 31, 2015
@poettering
Copy link
Member

We should still document this. Reopening hence.

@poettering poettering reopened this Aug 4, 2015
@richardmaw-codethink
Copy link
Contributor

http://www.freedesktop.org/software/systemd/man/timedatectl.html#set-ntp%20%5BBOOL%5D seems clear to me that it's about enabling/disabling the service.

poettering added a commit to poettering/systemd that referenced this issue Aug 16, 2015
This extends on the relationship between timedatectl's set-ntp command
and its effect on the systemd-timesyncd.service unit. This also links
that unit back to the timedatectl man page.

Closes systemd#798.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants