今天我发现我的电脑时钟在重启后就关闭了。timedatectl 显示它没有同步:
kfank@kfank-VirtualBox:~/tmp$ timedatectl
Local time: Fri 2020-06-05 11:58:44 PDT
Universal time: Fri 2020-06-05 18:58:44 UTC
RTC time: Fri 2020-06-05 18:58:45
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: no
我按照一些说明重新启动该服务,发现它已同步(系统时钟同步:是):
kfank@kfank-VirtualBox:~/tmp$ sudo timedatectl set-ntp true
kfank@kfank-VirtualBox:~/tmp$ timedatectl
Local time: Fri 2020-06-05 12:12:16 PDT
Universal time: Fri 2020-06-05 19:12:16 UTC
RTC time: Fri 2020-06-05 19:12:17
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: no
kfank@kfank-VirtualBox:~/tmp$ sudo systemctl restart systemd-timesyncd
kfank@kfank-VirtualBox:~/tmp$ timedatectl
Local time: Fri 2020-06-05 12:12:41 PDT
Universal time: Fri 2020-06-05 19:12:41 UTC
RTC time: Fri 2020-06-05 19:12:42
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no
然而,重启后它又回到了开始的位置:
kfank@kfank-VirtualBox:~$ timedatectl
Local time: Fri 2020-06-05 12:18:19 PDT
Universal time: Fri 2020-06-05 19:18:19 UTC
RTC time: Fri 2020-06-05 19:18:20
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: no
以下是我认为显示服务已启用(所以我希望它自动启动)但尚未运行的状态:
kfank@kfank-VirtualBox:~$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd-timesyncd.service(8)
有人可以给出一些关于如何修复和/或调试这个问题的指导吗?