1

Does Clock synchronization work differently in Ubuntu 18.04 and 20.04?

I have configured synchronization to local time server. After configuring clock synchronization in Ubuntu 18.04 , status is shown synchronized to time server. But, status in Ubuntu 20.04 is "Initial time synchronization to time server...".

Why Ubuntu 20.04 is not showing status "Synchronized"? IF it is not synchronized, how to resolve it?

systemd-timesyncd status in ubuntu 20.04 :

$ systemctl status systemd-timesyncd

● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-03-18 23:17:29 IST; 2s ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 476708 (systemd-timesyn)
     Status: "**Initial synchronization to time server** <server_ip>."
      Tasks: 2 (limit: 19009)
     Memory: 1.2M
     CGroup: /system.slice/systemd-timesyncd.service
             └─476708 /lib/systemd/systemd-timesyncd

.. systemd[1]: Starting Network Time Synchronization... .. systemd[1]: Started Network Time Synchronization. .. systemd-timesyncd[476708]: Initial synchronization to time server

systemd-timesyncd status in ubuntu 18.04 :

$ systemctl status systemd-timesyncd

● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2023-03-18 22:26:32 IST; 25min ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 7607 (systemd-timesyn)
   Status: " ** Synchronized to time server ** <server_ip>."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/systemd-timesyncd.service
           └─7607 /lib/systemd/systemd-timesyncd

.. systemd[1]: Starting Network Time Synchronization... .. systemd[1]: Started Network Time Synchronization. .. systemd-timesyncd[7607]: Synchronized to time server

1 Answers1

0

This is normal - apparently, the systemd team changed the wording in the timesyncd syslog entry from Ubuntu 18.04 to 20.04.

When timesyncd writes "Initial synchronization to time server", then it means it has successfully synchronized the time.

You can confirm that the timesyncd.service is working and the clock is synchronized by running timedatectl status.

And for more information about the current time server, synchronization etc. you can run timedatectl timesync-status.

For reference, here is the working output from my machine for all commands (I'm using Ubuntu 22.04, but the output should be similar).

$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-03-18 23:17:15 CET; 22h ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 3727200 (systemd-timesyn)
     Status: "Initial synchronization to time server 192.36.143.130:123 (0.dk.pool.ntp.org)."
      Tasks: 2 (limit: 77001)
     Memory: 1.3M
        CPU: 594ms
     CGroup: /system.slice/systemd-timesyncd.service
             └─3727200 /lib/systemd/systemd-timesyncd

Mar 18 23:17:14 xb systemd[1]: Starting Network Time Synchronization... Mar 18 23:17:15 xb systemd[1]: Started Network Time Synchronization. Mar 18 23:17:15 xb systemd-timesyncd[3727200]: Initial synchronization to time server 192.36.143.130:123 (0.dk.pool.ntp.org).

$ timedatectl status Local time: Sun 2023-03-19 22:01:55 CET Universal time: Sun 2023-03-19 21:01:55 UTC RTC time: Sun 2023-03-19 21:01:55 Time zone: Europe/Copenhagen (CET, +0100) System clock synchronized: yes NTP service: active RTC in local TZ: no

$ timedatectl timesync-status │ Server: 192.36.143.130 (0.dk.pool.ntp.org) │ Poll interval: 34min 8s (min: 32s; max 34min 8s) │ Leap: normal │ Version: 4 │ Stratum: 1 │ Reference: PPS │ Precision: 1us (-25) │ Root distance: 30us (max: 5s) │ Offset: +752us │ Delay: 15.248ms │ Jitter: 1.021ms │ Packet count: 44 │ Frequency: +25.579ppm

Artur Meinild
  • 26,018