Bug 311286 - NTP synchronisation can only be disabled if NTP is installed
Summary: NTP synchronisation can only be disabled if NTP is installed
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Unclassified
Component: kcm_clock (show other bugs)
Version: 4.8.4
Platform: Debian testing Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Paul Campbell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-07 04:09 UTC by Philippe Cloutier
Modified: 2015-02-27 19:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Cloutier 2012-12-07 04:09:14 UTC
As discussed in https://bugs.kde.org/show_bug.cgi?id=219035 kcm_clock was modified to prevent triggerring a "Unable to contact time server: ." error when NTP software is missing (usually, that is ntpdate). In KDE 4.8, the "Set date and time automatically" option will be grayed out when neither ntpdate nor rdate are available. This prevents users from enabling NTP synchronisation when the system doesn't support it.

However, it seems the case where NTP synchronisation is enabled was not expected. It is correct to prevent changing the preference if NTP is unavailable, but not to lock the state to enabled. If the module starts while NTP synchronisation is enabled but ntpdate is unavailable, NTP synchronisation should be automatically disabled.

Since NTP is disabled by default, this scenario usually happens on a system where ntpdate starts installed. NTP synchronisation is enabled in kcm_clock and ntpdate is removed at a later point. After, if kcm_clock is started, it will show the bug.

This is the new form of #142815.
Comment 1 Kai Uwe Broulik 2012-12-09 00:25:21 UTC
Should be easily achieveable by adding a
setDateTimeAuto->setChecked(false);
to the
if (ntpUtility.isEmpty()) {
in [kde-workspace] kcontrol/dateandtime/dtime.cpp 
that disables the NTP if it is unavailable.
Comment 2 David Edmundson 2015-02-27 19:02:37 UTC
Git commit b6ae01ca8ea776c97cc57836401ca9696e2529e8 by David Edmundson.
Committed on 14/02/2015 at 13:50.
Pushed by davidedmundson into branch 'master'.

Add systemd support into the clock KCM as an optional dependency

The current time setting helper is incredibly broken.

It manually tries to run a range of NTP utilities, all of which are
deprecated.

We can just call timedated directly and cut out the middleman as it has
uses polkit anyway.

This is currently an optional dependency, and the original helper still
exists. It makes the code messy, but we have users to support for now.

Detection is done at runtime
Related: bug 196316, bug 317784, bug 319072, bug 337012, bug 339582, bug 241817, bug 178968, bug 320456, bug 317999, bug 337659
REVIEW: 122400

M  +5    -1    kcms/dateandtime/CMakeLists.txt
M  +22   -12   kcms/dateandtime/dateandtime.ui
M  +44   -30   kcms/dateandtime/dtime.cpp
M  +2    -1    kcms/dateandtime/dtime.h
M  +80   -7    kcms/dateandtime/main.cpp
M  +5    -1    kcms/dateandtime/main.h
A  +43   -0    kcms/dateandtime/timedated1.xml

http://commits.kde.org/plasma-desktop/b6ae01ca8ea776c97cc57836401ca9696e2529e8