"Automatic Date & Time" doesn't reflect the service status

Bug #1848309 reported by Alex
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gnome-control-center
New
Unknown
gnome-control-center (Ubuntu)
Triaged
Low
Unassigned

Bug Description

In my always up-to-date Eoan the "Automatic Date & Time" adjustment is broken since around two months.

0 * * * * sudo ntpdate 0.ubuntu.pool.ntp.org >> /tmp/ntpsync

...is my crontab workaround to get proper time on Ubuntu Eoan.

Revision history for this message
Alex (loxal) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote : Bug is not a security issue

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

information type: Private Security → Public
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote : Re: "Automatic Date & Time" is broken

Can you please elaborate on *how* it is broken. Does it not adjust the date/time at all, or does it use an incorrect timezone?

affects: ubuntu-docs (Ubuntu) → gnome-control-center (Ubuntu)
Changed in gnome-control-center (Ubuntu):
status: New → Incomplete
Revision history for this message
Alex (loxal) wrote :

Always when I click on the slider the slider just goes back without adjusting anything.

Revision history for this message
Sebastien Bacher (seb128) wrote :

The report lack basic informations, please submit using ubuntu-bug. Like the Ubuntu version used isn't even specified.
Could you also add your 'journalctl -b 0' log?

Changed in gnome-control-center (Ubuntu):
importance: Undecided → Low
Revision history for this message
Alex (loxal) wrote :

As I wrote, I was using the very latest Eoan packages for the past months as this bug occurred and persisted. Therefore I could not provide any specific Ubuntu version as the version number was just "latest development".

############## related jounrnalctl messages
Oct 21 12:37:19 sun dbus-daemon[1577]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.284' (uid=1000 pid=21820 comm="gnome-control-center datetime " label="unconfined")
Oct 21 12:37:19 sun systemd[1]: systemd-timedated.service: Succeeded.
Oct 21 12:37:19 sun systemd[1]: Starting Time & Date Service...
Oct 21 12:37:19 sun dbus-daemon[1577]: [system] Successfully activated service 'org.freedesktop.timedate1'
Oct 21 12:37:19 sun systemd[1]: Started Time & Date Service.
Oct 21 12:37:49 sun dbus-daemon[1577]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.284' (uid=1000 pid=21820 comm="gnome-control-center datetime " label="unconfined")
Oct 21 12:37:49 sun systemd[1]: systemd-timedated.service: Succeeded.
Oct 21 12:37:49 sun systemd[1]: Starting Time & Date Service...
Oct 21 12:37:49 sun dbus-daemon[1577]: [system] Successfully activated service 'org.freedesktop.timedate1'
Oct 21 12:37:49 sun systemd[1]: Started Time & Date Service.
Oct 21 12:37:58 sun xdg-desktop-por[4719]: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: App introspection not allowed
Oct 21 12:38:19 sun dbus-daemon[1577]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.284' (uid=1000 pid=21820 comm="gnome-control-center datetime " label="unconfined")
Oct 21 12:38:19 sun systemd[1]: systemd-timedated.service: Succeeded.
Oct 21 12:38:19 sun systemd[1]: Starting Time & Date Service...
Oct 21 12:38:20 sun dbus-daemon[1577]: [system] Successfully activated service 'org.freedesktop.timedate1'
Oct 21 12:38:20 sun systemd[1]: Started Time & Date Service.
##############

ubuntu-bug asks me to provide a PID and I have really other priorities to deal with than to figure out which PID it is supposed to be...

alex@sun:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.10
Release: 19.10
Codename: eoan

I hope this helps.

Revision history for this message
Sebastien Bacher (seb128) wrote :

what's the output of 'timedatectl status'?

Revision history for this message
Alex (loxal) wrote :

$ timedatectl status
               Local time: Mon 2019-10-21 15:46:41 CEST
           Universal time: Mon 2019-10-21 13:46:41 UTC
                 RTC time: Mon 2019-10-21 13:46:37
                Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

Revision history for this message
Sebastien Bacher (seb128) wrote :

So that's consistent with the switch status.

Can you change the status in the setting and do
$ systemctl status systemd-timesyncd.service
and copy the log here?

What happens if you try then to enable sync with that command instead of the settings?
$ timedatectl set-ntp true

Revision history for this message
Alex (loxal) wrote :

 sudo systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
Condition: start condition failed at Mon 2019-10-21 12:34:47 CEST; 4h 5min ago
     Docs: man:systemd-timesyncd.service(8)

Oct 21 12:34:29 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 12:34:47 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.

#####

$ timedatectl set-ntp true

$ systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
Condition: start condition failed at Mon 2019-10-21 17:19:40 CEST; 1s ago
           └─ ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
     Docs: man:systemd-timesyncd.service(8)

Oct 21 12:34:29 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 12:34:47 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 16:41:31 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 17:19:31 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 17:19:32 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 17:19:33 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 17:19:34 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Oct 21 17:19:40 sun systemd[1]: Condition check resulted in Network Time Synchronization being skipped.

...still the slider cannot be activated.

Revision history for this message
Sebastien Bacher (seb128) wrote :

The sync is failing due to 'ConditionFileIsExecutable=!/usr/sbin/ntpd'

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2019-10-21 19:27, Sebastien Bacher wrote:
> The sync is failing due to 'ConditionFileIsExecutable=!/usr/sbin/ntpd'

That file would be provided by the universe package ntp. Are there reasons to move it back to main?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Right, ntpd isn't installed by default/needed, it's weird because on my 19.10 installation the .service doesn't have that condition

what's the output of
- dpkg -S /lib/systemd/system/systemd-timesyncd.service
- dpkg -l systemd
- ls -l /lib/systemd/system/systemd-timesyncd.service

on your installation?

Revision history for this message
Alex (loxal) wrote :

alex@sun:~/$ dpkg -S /lib/systemd/system/systemd-timesyncd.service
systemd: /lib/systemd/system/systemd-timesyncd.service
alex@sun:~/$ dpkg -l systemd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii systemd 242-7ubuntu3 amd64 system and service manager
alex@sun:~/$ ls -l /lib/systemd/system/systemd-timesyncd.service
-rw-r--r-- 1 root root 1489 Oct 11 16:19 /lib/systemd/system/systemd-timesyncd.service

Revision history for this message
Sebastien Bacher (seb128) wrote :

Oh, sorry, I read that the wrong way
ConditionFileIsExecutable=!/usr/sbin/ntpd

Which means systemd-timesyncd isn't doing syncing when ntp is installed

Did you install ntpd? Does it work better if you uninstall it?

Revision history for this message
Alex (loxal) wrote :

purging and reinstalling `ntpdate` resolved the problem. IMO opinion the pkg manager should prevent the user from making breaking system integrity by miss-installing certain package. Ok, this might have happend in the eoan dev cycle where I have started to use eoan... but still future updates should have corrected this inconsistency.

Revision history for this message
Sebastien Bacher (seb128) wrote :

It's a valid choice to want to replace the default time syncing by using ntpd, the issue there is that the graphical settings don't communicate much about what is happening

summary: - "Automatic Date & Time" is broken
+ "Automatic Date & Time" doesn't reflect the service status
Changed in gnome-control-center (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Ok, so the real issue is a systemd one and discussed in bug #1849156, I'm keeping this one about the fact that UI doesn't communicate about the service being disabled though (woulc be worth sending upstream on gitlab if someone wants to do that)

Changed in gnome-control-center (Ubuntu):
status: Confirmed → Triaged
Changed in gnome-control-center:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.