Bug 55938

Summary: org.freedesktop.timedate1 SetNTP should not always enable the ntpd.service
Product: systemd Reporter: twelve.eighty
Component: generalAssignee: systemd-bugs
Status: RESOLVED NOTOURBUG QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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:
http://cgit.freedesktop.org/systemd/systemd/tree/src/timedate/timedated.c

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.