Bug 55938 - org.freedesktop.timedate1 SetNTP should not always enable the ntpd.service
Summary: org.freedesktop.timedate1 SetNTP should not always enable the ntpd.service
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
Depends on:
Reported: 2012-10-12 19:35 UTC by twelve.eighty
Modified: 2012-10-18 03:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description twelve.eighty 2012-10-12 19:35:36 UTC
When using systemd, NetworkManager, NTP and then networkmanager-dispatcher-ntpd to start NTP after NetworkManager has established a connection, the ntpd.service service gets enabled by a call to gdbus:

gdbus call \
        --system \
        --object-path /org/freedesktop/timedate1 \
        --dest org.freedesktop.timedate1 \
        --method org.freedesktop.timedate1.SetNTP true false

The problem is that the org.freedesktop.timedate1.SetNTP method appears to *enable* the ntpd.service and then start it. This should not be done, since in a NetworkManager scenario, the ntpd.service should be left disabled and only *started* when a connection is made.

The result of this bug is that upon a reboot, ntpd.service is automatically started, BEFORE network manager creates a connection. Even after ntpd.service is disabled again, the next time a connection is made, ntpd.service is re-enabled.

I believe this is the problem:

Line 871: r = enable_ntp(connection, &error);

I think that should be removed, so that only the remaining start_ntp() call is made.
Comment 1 Lennart Poettering 2012-10-17 16:39:43 UTC
Uh oh. THis is misusage of the SetNTP API really. That call is for enabling+starting NTP, nothing else. And that's documented in http://www.freedesktop.org/wiki/Software/systemd/timedated

NM should not invoke this call.
Comment 2 twelve.eighty 2012-10-18 03:31:39 UTC
Okay - that's fair enough. The real culprit is the networkmanager-dispatcher-ntpd package then. I'll take this to Arch's Bugzilla.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.