How to synchronize time
Greetings folks,
My clock is off. I am running ubuntu 20.04.3 LTS. I installed systemd-timesyncd and opened port 37 udp and tcp. glenn@LinuxBox:~$ sudo timedatectl set-ntp on How to make the time synchronize? Code:
glenn@LinuxBox:~$ timedatectl --glenn |
There are several ways to synchronize time. I believe that Ubuntu uses systemd-timesyncd as its default time client which does not appear to be active. Check its status via the command:
sudo systemctl status systemd-timesyncd |
After you have a NTP client running, you need to configure NTP to address NTPD servers!
To get a FAST sync, there is a command line to quickly sync it up, but the ntp client must not be running at the time. So check the man page and verify the command. Start with the man page for systemd-timedated.service and you cannot go wrong. (This was all a LOT easier before systemd, but it is still doable. Let us know if you get stuck.) If it is running, stop it. run the sync command, then start the service and it should keep your clock spot on forever. |
[code]
glenn@LinuxBox:~$ sudo systemctl status systemd-timesyncd [sudo] password for glenn: ● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; ve> Active: active (running) since Sun 2022-04-03 03:58:42 PDT; 3h 36min ago Docs: man:systemd-timesyncd.service(8) Main PID: 4991 (systemd-timesyn) Status: "Idle." Tasks: 2 (limit: 6087) Memory: 1.3M CGroup: /system.slice/systemd-timesyncd.service └─4991 /lib/systemd/systemd-timesyncd Apr 03 03:58:42 LinuxBox systemd[1]: Starting Network Time Synchronization... Apr 03 03:58:42 LinuxBox systemd[1]: Started Network Time Synchronization. glenn@LinuxBox:~$ man systemd.timedated.service No manual entry for systemd.timedated.service [code] Still not synchronized. Thanks, --glenn |
Quote:
Try Code:
man systemd-timedated.service |
I would of expected an initial time sync message in the status that syncs to ntp.ubuntu.com
Post the contents of your /etc/systemd/timesyncd.conf file. Are you using a VPN service? |
Newbie here finding the man pages less than helpful. I don't have a clue.
Code:
# This file is part of systemd. -glenn |
The default settings I guess are compiled into systemd. I would try uncommenting RootDistanceMaxSec and change it from 5 to 10 seconds and see what happens. And restart systemd-timesyncd
|
Set RootDistanceMaxSec to 10 and restarted systemd-timesyncd.
Code:
glenn@LinuxBox:~$ timedatectl --glenn |
Check the status to see if it connected to a time server
It appears that your hardware clock is set for local time but your system thinks its UTC (RTC in local TZ: no). |
I switched to chrony and it hooked right up and synchronized.
Thanks for the help, --glenn |
All times are GMT -5. The time now is 03:24 PM. |