Score:1

Time does not sync

es flag

I have set time to sync with Internet servers in "Time and Date Settings". No error shown there. However time does bot sync and is off by several days. systemctl status systemd-timesyncd tells the respective service unit could not be found. How to fix this?

Edit:

The notebook does not have main battery, and maybe secondary battery, if any, is dead, so I want time to be set from Internet ASAP after boot even if a user does not log in.

$ timedatectl status
               Local time: su 2023-06-25 11:53:30 EEST  
           Universal time: su 2023-06-25 08:53:30 UTC   
                 RTC time: pe 1980-01-04 00:15:56       
                Time zone: Europe/Helsinki (EEST, +0300)
System clock synchronized: no                           
              NTP service: n/a                          
          RTC in local TZ: no
     
$ timedatectl timesync-status
Failed to query server: The name org.freedesktop.timesync1 was not provided by any .service files

$ systemctl status systemd-timesyncd
Unit systemd-timesyncd.service could not be found.

$ LC_ALL=C systemctl status ntp
* ntp.service - Network Time Service
     Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Mon 2023-03-27 20:56:59 EEST; 2 months 28 days ago
       Docs: man:ntpd(8)
   Main PID: 593 (code=exited, status=0/SUCCESS)

Mar 27 20:55:19 jarnos-8510w ntpd[593]: Soliciting pool server 65.21.58.9
Mar 27 20:56:22 jarnos-8510w ntpd[593]: Soliciting pool server 95.216.71.38
Mar 27 20:56:23 jarnos-8510w ntpd[593]: Soliciting pool server 95.216.218.15
Mar 27 20:56:25 jarnos-8510w ntpd[593]: Soliciting pool server 91.189.91.157
Mar 27 20:56:25 jarnos-8510w ntpd[593]: Soliciting pool server 62.241.198.253
Mar 27 20:56:26 jarnos-8510w ntpd[593]: Soliciting pool server 65.109.217.171
Mar 27 20:56:59 jarnos-8510w ntpd[593]: ntpd exiting on signal 15 (Terminated)
Mar 27 20:56:59 jarnos-8510w systemd[1]: Stopping Network Time Service...
Mar 27 20:56:59 jarnos-8510w systemd[1]: ntp.service: Succeeded.
Mar 27 20:56:59 jarnos-8510w systemd[1]: Stopped Network Time Service.

$ systemctl status chrony
Unit chrony.service could not be found.

ntp and sntp is installed, chrony is not.

Artur Meinild avatar
vn flag
Could you please provide full output (in your question) of the following commands: `timedatectl status`, `timedatectl timesync-status`, `systemctl status systemd-timesyncd` and `systemctl status ntp`. Thanks.
Artur Meinild avatar
vn flag
Also, please specify if you knowingly installed another timesync daemon, such as `ntp` or `chrony`?
mchid avatar
bo flag
Also if I might add: `systemctl status chrony` to the list of commands. If I'm not mistaken, if you are using chrony and you run `timedatectl status` it should say `NTP service: active` even if/when the ntp service cannot be found.
es flag
@ArturMeinild After editing, I installed `systemd-timesyncd` and removed `ntp`. That did not change the output of `systemctl status ntp`, but `timedatectl status` now tells NTP service is active. Should I remove `sntp`, too?
es flag
@mchid please see above.
es flag
Seems to be working after the changes.
mchid avatar
bo flag
@jarno I think you should keep sntp. From what I understand and based on [the `systemd-timesyncd` release notes](https://github.com/systemd/systemd/blob/v213/NEWS#L5) and [other answers like this one](https://unix.stackexchange.com/a/504387/), `systemd-timesyncd` uses `sntp` by default. Not sure why `sntp` is not showing as a dependency of `systemd-timesyncd`, however.
Score:1
es flag

Command sudo apt install systemd-timesyncd helped in this case. It also removed ntp.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.