Document that timedatectl set-ntp == systemctl {enable/disable} systemd-timesyncd.service · Issue #798 · systemd/systemd
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.
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.
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
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
poettering added a commit to poettering/systemd that referenced this issue
Aug 16, 2015This 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.