timedatectl 没有返回正确的信息

timedatectl 没有返回正确的信息

我有 2 台服务器运行完全相同的 Ubuntu 和内核版本。两台服务器都具有相同的硬件,并使用相同的 USB 驱动器启动。

user@server1:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
user@server1:~$
user@server1:~$ uname -a
Linux satlab-rs1 4.15.0-156-generic #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021 
x86_64 x86_64 x86_64 GNU/Linux
user@server1:~$

然而,在 server1 上,timedatectl 返回了正确的 TZ,但返回了错误的日期和时间

user@server1:~$ timedatectl
                  Local time: Fri 2021-08-27 02:24:42 +08
              Universal time: Thu 2021-08-26 18:24:42 UTC
                    RTC time: Sun 2006-01-01 05:46:28
                   Time zone: Etc/GMT-8 (+08, +0800)
   System clock synchronized: no
systemd-timesyncd.service active: yes
             RTC in local TZ: no
user@server1:~$

在server2上,返回的信息是正确的

user@server2:~$ timedatectl
                  Local time: Fri 2022-04-15 21:49:00 PDT
              Universal time: Sat 2022-04-16 04:49:00 UTC
                    RTC time: Sat 2022-04-16 04:48:59
                   Time zone: America/Los_Angeles (PDT, -0700)
   System clock synchronized: no
systemd-timesyncd.service active: yes
             RTC in local TZ: no
user@server2:~$

我尝试了 dpkg-reconfigure tzdata,但问题并没有得到解决,尽管 /etc/timezone 是正确的

user@server1:~$ cat /etc/timezone
America/Los_Angeles
user@server1:~$

我也使用了“sudo timedatectl set-timezone”,但问题仍然没有得到解决。

知道这里发生什么事了吗?

相关内容