Bug 1550259 - timedatectl controls installed NTP service instead of systemd-timesyncd - docs are out of sync
Summary: timedatectl controls installed NTP service instead of systemd-timesyncd - doc...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1735584
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-28 21:00 UTC by Alan Jenkins
Modified: 2019-10-24 12:49 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-24 12:49:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alan Jenkins 2018-02-28 21:00:49 UTC
Description of problem:

timedatectl shows

    systemd-timesyncd.service active: yes

but actually it is masked and only chronyd.service is active.

I've hit this at least once.  I don't like my tools lying to me, it wastes time when troubleshooting.


Version-Release number of selected component (if applicable):
systemd-234-9.fc27.x86_64
timedatex-0.5-2.fc27.x86_64

How reproducible: always


Steps to Reproduce:
1. Install Fedora 27 Workstation
2. timedatectl
3. systemctl status chronyd systemd-timesyncd

Actual results:

$ timedatectl
                      Local time: Wed 2018-02-28 20:06:42 GMT
                  Universal time: Wed 2018-02-28 20:06:42 UTC
                        RTC time: Wed 2018-02-28 20:06:42
                       Time zone: Europe/London (GMT, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

$ systemctl status chronyd systemd-timesyncd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-02-28 20:05:55 GMT; 54s ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
  Process: 630 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
  Process: 624 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 627 (chronyd)
    Tasks: 1 (limit: 4703)
   Memory: 2.4M
   CGroup: /system.slice/chronyd.service
           └─627 /usr/sbin/chronyd

● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd-timesyncd.service(8)

Expected results: no lies, only consistency

Additional info:

I expect you're fed up of this already.  I have a specific idea in mind, maybe you'd not considered this effect so you hadn't thought of the need for it.

timedatex should not really be masking systemd-timedated.service either.  systemd warns about masks at boot time, like:

    rsync.service: Cannot add dependency job, ignoring: Unit rsync.service is masked

If we are too timid to patch the systemd package to behave as required for Fedora (Workstation, Server, whatever) we should still be patching it, just enough to allow a clean override.

I personally don't need gnome to support disabling ntp from the gui.  But clearly there's a _reason_ we ended up with timedatex in Fedora, and hence this icky bug.  Also I'm assuming that upstream rejects any patch to improve this, after they deliberately switched to only work with systemd-timesyncd.service, updated the message text and man page, and simply told us that setting the "NTP"  property will no longer be considered a valid use case for their api.

## Use the alternatives system

There is a well-known override mechanism (originally from Debian, naturally) - https://fedoraproject.org/wiki/Alternatives_system.  This should be applied to change timedatectl to fix the message text, /usr/share/man/man1/timedatectl.1 to fix the documentation, and also to /lib/systemd/system/systemd-timedated.service.

Generally systemd is happy to have unit files being symlinks, so I think this would not be a problem.  Notice that e.g. `systemctl status systemd-timedated` will provide a small hint, in several places you will be able to see timedatex instead of systemd-timedated.

## or split systemd-timedated into a subpackage of systemd

That said, it might be simpler to engineer systemd-timedated as a separate subpackage instead.  AIUI, the RPMs would naturally conflict, if they both provided /usr/bin/timedatectl etc.

Comment 1 Miroslav Lichvar 2018-03-01 11:43:33 UTC
It seems the output of timedatectl changed not that long ago with this commit:
https://github.com/systemd/systemd/commit/3ec530a1890925efe347f739917dd4078c1b1942

Let's ask the Fedora systemd maintainers if this is something what could be fixed downstream or upstream.

To me it looks like a bug that timedatectl assumes the service providing the org.freedesktop.timedate1 interface is the one shipped with systemd. Would it be possible to change the "systemd-timesyncd.service active" string with something more generic like "Time synchronization service active"?

The man page of timedatectl could explain that it communicates over D-Bus, usually with the systemd-timedated service, which controls systemd-timesyncd, but it does not have to be always the case.

If this does not work, timedatex could probably provide a replacement for timedatectl in addition to systemd-timedated, but some changes in the systemd packaging would be needed to avoid the file conflicts in /usr/bin and /usr/share/man/man1 as suggested in the comment #0.

Comment 2 Zbigniew Jędrzejewski-Szmek 2018-03-01 14:23:29 UTC
Frankly, I'd prefer to go back, and make timedatectl again manage multiple ntp daemons (in the sense of enabling/disabling one of the installed implementations). The approach that timedatectl manages just systemd-timesyncd has been mostly a source of bugs and a constant annoyance to users. I haven't looked at the details, so I don't have an opinion whether it makes sense to bring ntp-units.d back [1], or some different mechanism should be implemented and what role timedatex should play.

[1] commit removing ntp-units.d: https://github.com/systemd/systemd/commit/b72ddf0f4f

Comment 3 Ben Cotton 2018-11-27 16:50:23 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2018-11-30 20:08:14 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Zbigniew Jędrzejewski-Szmek 2019-10-24 12:49:37 UTC
This got solved actually as suggested above and the changes in behaviour were reverted.
If the output is still confusing in any way, please open a new bug.


Note You need to log in before you can comment on or make changes to this bug.