Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 9871  / 1 Year ago, fri, may 26, 2023, 3:27:47

I want the time to sync, but it's not. I tried running the following commands, but it's still not syncing.


# timedatectl set-ntp off
# timedatectl set-ntp on
# timedatectl status
Local time: Fri 2021-08-06 20:01:43 EDT
Universal time: Sat 2021-08-07 00:01:43 UTC
RTC time: Fri 2021-08-06 20:01:43
Time zone: America/New_York (EDT, -0400)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: no

Edit: More info


systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-08-07 15:26:10 EDT; 58min ago
Docs: man:systemd-timesyncd.service(8)
Process: 9351 ExecStart=/lib/systemd/systemd-timesyncd (code=exited, status=238/STATE_DIRECTORY)
Main PID: 9351 (code=exited, status=238/STATE_DIRECTORY)


# journalctl -u systemd-timesyncd
1]: systemd-timesyncd.service: Service has no hold-off time, scheduling restart.
1]: systemd-timesyncd.service: Scheduled restart job, restart counter is at 5.
1]: Stopped Network Time Synchronization.
1]: systemd-timesyncd.service: Start request repeated too quickly.
1]: systemd-timesyncd.service: Failed with result 'exit-code'.
1]: Failed to start Network Time Synchronization.

Running Ubuntu 18.04. Internet works and can browse the internet.


More From » sync

 Answers
3

Apparently there was a directory permissions bug and it affects multiple distros. The solution is simple.


$ sudo chmod 0700 /var/lib/private
$ sudo systemctl restart systemd-timesyncd
$ sudo timedatectl status

Also, this may or may not be needed:


$ sudo rm -r /var/lib/private/systemd

Source:
https://bbs.archlinux.org/viewtopic.php?id=233277


[#1279] Sunday, May 28, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
urvedcaly

Total Points: 171
Total Questions: 118
Total Answers: 124

Location: Cape Verde
Member since Fri, Nov 27, 2020
4 Years ago
urvedcaly questions
Tue, Nov 8, 22, 19:40, 2 Years ago
Wed, Jan 19, 22, 08:09, 2 Years ago
Thu, May 13, 21, 03:34, 3 Years ago
Wed, Sep 14, 22, 16:14, 2 Years ago
;