Bug 858795 - kcm_clock: add systemd timedated support
kcm_clock: add systemd timedated support
Product: Fedora
Classification: Fedora
Component: kde-workspace (Show other bugs)
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukáš Tinkl
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2012-09-19 13:17 EDT by Rex Dieter
Modified: 2015-07-13 04:12 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-09-22 09:45:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rex Dieter 2012-09-19 13:17:34 EDT
instead of calling ntpdate or rdate directly, add support for using systemd timedated service as outlined here:
Comment 1 Rex Dieter 2012-09-19 13:26:13 EDT
Looks like this is the cli way:

qdbus --system org.freedesktop.timedate1 /org/freedesktop/timedate1 \
   org.freedesktop.timedate1.SetNTP 1 1

shouldn't be too hard to hook into that in the code.
Comment 2 Rex Dieter 2012-09-19 13:26:58 EDT
Oh, and see also bug #816752 "systemd v28 changes indirectly break date and ntpdate"
Comment 3 Kevin Kofler 2012-09-19 16:40:45 EDT
The right way to handle this would be using QtDBus, not spawning qdbus through KProcess or QProcess. Also, the KDE-specific KAuth mechanism for kcm_clock should then go away entirely, because systemd already handles the PolicyKit stuff. Basically all the backend code of kcm_clock can be thrown away in favor of systemd's implementation.
Comment 4 Kevin Kofler 2012-09-19 16:46:50 EDT
This is also somewhat related to bug #829881 because we'd be using the org.freedesktop.timedate1.* policies instead of the org.kde.kcontrol.kcmclock.save one (assuming we implement this correctly – again, just spawning qdbus as root instead of ntpdate in the existing kcm_clock mechanism is NOT the correct way, the point of the systemd service is that it handles everything including the polkit stuff).
Comment 5 Lukáš Tinkl 2012-09-19 17:02:01 EDT
Aye, let's see :)
Comment 6 Lukáš Tinkl 2012-09-22 09:45:58 EDT
So, after having the prototype code ready and working, I, however, decided not to go this way for several reasons:

1. the current KAuth code works fine and we'd have to keep it anyway, either for compatibility reasons or for people who decide to disable systemd-timedated which would result in code bloat, not reduction
2. systemd-timedated doesn't correctly read the timezone back, if you set it by the traditional means (like using date(1) or tzset(3))
3. systemd-timedated has distinct methods for changing datetime, timezone and ntp preference, however, each of these methods invokes polkit in the background, resulting in 3 (!) auth dialogs presented to the user in consecution when confirming the KDE date/time control dialog
4. systemd-timedated lacks a signal telling us the date/time/timezone have been indeed changed

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