UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Local time: Sun 2022-04-03 05:50:21 PDT
Universal time: Sun 2022-04-03 12:50:21 UTC
RTC time: Sun 2022-04-03 12:50:22
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
Thanks in advance.
--glenn
Last edited by PsychoHermit; 04-03-2022 at 03:07 PM.
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:
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]
Newbie here finding the man pages less than helpful. I don't have a clue.
Code:
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See timesyncd.conf(5) for details.
[Time]
#NTP=
#FallbackNTP=ntp.ubuntu.com
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
Thanks,
-glenn
Last edited by PsychoHermit; 04-03-2022 at 06:44 PM.
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
Local time: Sun 2022-04-03 11:48:05 PDT
Universal time: Sun 2022-04-03 18:48:05 UTC
RTC time: Sun 2022-04-03 18:48:05
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.