This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Semi-SOLVED] Cannot "set date and time automatically"

Tags: None
(comma "," separated)
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Hi,

I've just moved to KDE (Kubuntu) after using Unity and Gnome Shell, which are both still installed on my system (so I'm not sure if there's some conflict there).

I've been trying to set System Settings > Date & Time > Set date and time automatically. I attempt to check the box, but after clicking "Apply", there is a pause, then the checkbox reverts itself. I read somewhere that I needed to install ntp, so I tried that, then got the error "Unable to contact time server: pool.ntp.org.". I read elsewhere that I shouldn't have ntp installed, but only ntpdate, which I already had, so I uninstalled ntp.

I've also tried
Code: Select all
$ sudo ntpdate -u pool.ntp.org
which works fine. I also tried
Code: Select all
$ sudo systemsettings
This spat out a whole bunch of errors such as
Code: Select all
Error: "/var/tmp/kdecache-lee" is owned by uid 1000 instead of uid 0.
but when I looked at the Date & Time settings, there was a check next to "Set date and time automatically."

Does this mean that the clock is being set automatically? If so, I guess I should file a bug?

Last edited by sparhawk on Tue Nov 20, 2012 6:52 am, edited 1 time in total.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
In general, please do not use "sudo" to run KDE applications - it can cause quite severe damage to your local user and the permissions for many KDE configuration and data files. Please make sure to use "kdesudo" whenever attempting to launch KDE (or any other) graphical applications as root. In most cases KDE applications now use PolKit through the KAuth framework, so it is not necessary to run them as root (they will prompt for permission to perform their actions as and when needed).

As for the Date & Time issue - automatic setting is to the best of my knowledge quite broken at this time. I would suggest setting it once, or following your distribution's documentation to setup ntpd to automatically update your clock if this is needed.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Thank you for the quick response.

bcooksley wrote:In general, please do not use "sudo" to run KDE applications - it can cause quite severe damage to your local user and the permissions for many KDE configuration and data files. Please make sure to use "kdesudo" whenever attempting to launch KDE (or any other) graphical applications as root.

Thanks for the tip. I tried again and this time I got no permission errors.

bcooksley wrote:In most cases KDE applications now use PolKit through the KAuth framework, so it is not necessary to run them as root (they will prompt for permission to perform their actions as and when needed).

I guess in this situation it's not the case, since normal system settings and kdesudo systemsettings exhibit different results.

bcooksley wrote:As for the Date & Time issue - automatic setting is to the best of my knowledge quite broken at this time. I would suggest setting it once, or following your distribution's documentation to setup ntpd to automatically update your clock if this is needed.

Do you know if there is some kind of kde log to see if it is being set already?
Cheers.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The only "kde log" I know of is ~/.xsession-errors but I suspect the automatic time setting is not being logged there. I'm not sure how that mechanism works actually (does it configure ntp, or does it do something by itself?) so it is a little hard to tell.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Hmm... I did manage to find some ntp entries in my syslog, but I'm not sure to what these relate. (They seem very frequent, but possibly every time I wake the computer up.) I presume this means that ntp is automatically syncing the time at a system level. Would this imply that KDE is also reading that same time?
Code: Select all
$ egrep ntp /var/log/syslog
Nov 19 08:37:50 lee-XPS-17 ntpdate[18659]: adjust time server 91.189.94.4 offset -0.096163 sec
Nov 19 09:07:34 lee-XPS-17 ntpdate[19740]: adjust time server 91.189.94.4 offset -0.035240 sec
Nov 19 09:25:26 lee-XPS-17 ntpdate[20865]: adjust time server 91.189.94.4 offset -0.070578 sec
Nov 19 10:04:13 lee-XPS-17 ntpdate[21987]: adjust time server 91.189.94.4 offset 0.415407 sec
Nov 19 15:51:54 lee-XPS-17 ntpdate[23035]: adjust time server 91.189.94.4 offset 0.248233 sec
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
KDE uses the system clock for all time/date related tasks - so yes, setting the system clock will change it for KDE as well.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Thank you very much for your help. I've marked this topic as "semi-SOLVED", since running system settings with administrator privileges probably works. Thanks again.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell