Bug 2612 - [Anolis 23 Preview][x86_64]时间同步测试失败,硬件时间与系统时间相差8小时
Summary: [Anolis 23 Preview][x86_64]时间同步测试失败,硬件时间与系统时间相差8小时
Status: CLOSED WONTFIX
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: Images&Installations (show other bugs) Images&Installations
Version: 23.0
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: xuchunmei
QA Contact:
URL:
Whiteboard:
Keywords:
: 2610 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-27 16:30 UTC by liuyaqing
Modified: 2022-11-02 19:09 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description liuyaqing alibaba_cloud_group 2022-10-27 16:30:19 UTC
Description of problem:
anolis23 previrw 在执行时间同步测试失败,硬件时间与系统时间相差8小时

Version-Release number of selected component (if applicable):
# uname -r
5.19.0-2_rc1.an23.x86_64

# cat /etc/image-id
image_name="Anolis OS 23.  64 bit"
image_id="anolis_23__x64_20G_alibase_20221019.vhd"
release_date="20221019203103"

How reproducible:
必现

Steps to Reproduce:
1.安装anolis23 vhd镜像

2.运行vhd镜像测试,时间同步用例执行失败

3.查看硬件时间,系统时间,相差8小时
# hwclock 
2022-10-27 23:33:21.511497+08:00

# date 
Thu Oct 27 15:33:23 CST 2022

Actual results:
硬件时间与系统时间相差8小时

Expected results:
硬件时间,系统时间同步

Additional info:
Comment 1 xuchunmei alibaba_cloud_group 2022-10-27 16:39:14 UTC
*** Bug 2610 has been marked as a duplicate of this bug. ***
Comment 2 happy_orange alibaba_cloud_group 2022-10-27 17:16:41 UTC
date命令操作Linux的系统(软件)时钟,hwclock命令操作硬件时钟(rtc模块)。
当前系统里展示的时区为 上海,所以 8个小时为正常时差。
[root@iZbp1jenlv6zmemz4juo9xZ etc]# date
Thu Oct 27 17:07:07 CST 2022
[root@iZbp1jenlv6zmemz4juo9xZ etc]#
[root@iZbp1jenlv6zmemz4juo9xZ etc]#
[root@iZbp1jenlv6zmemz4juo9xZ etc]#
[root@iZbp1jenlv6zmemz4juo9xZ etc]# timedatectl
               Local time: Thu 2022-10-27 17:07:13 CST
           Universal time: Thu 2022-10-27 09:07:13 UTC
                 RTC time: Thu 2022-10-27 17:07:12
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
[root@iZbp1jenlv6zmemz4juo9xZ etc]# hwclock
2022-10-28 01:08:03.104259+08:00
Comment 3 chuyang_94 alibaba_cloud_group 2022-10-27 18:05:19 UTC
(In reply to happy_orange from comment #2)
> date命令操作Linux的系统(软件)时钟,hwclock命令操作硬件时钟(rtc模块)。
> 当前系统里展示的时区为 上海,所以 8个小时为正常时差。
> [root@iZbp1jenlv6zmemz4juo9xZ etc]# date
> Thu Oct 27 17:07:07 CST 2022
> [root@iZbp1jenlv6zmemz4juo9xZ etc]#
> [root@iZbp1jenlv6zmemz4juo9xZ etc]#
> [root@iZbp1jenlv6zmemz4juo9xZ etc]#
> [root@iZbp1jenlv6zmemz4juo9xZ etc]# timedatectl
>                Local time: Thu 2022-10-27 17:07:13 CST
>            Universal time: Thu 2022-10-27 09:07:13 UTC
>                  RTC time: Thu 2022-10-27 17:07:12
>                 Time zone: Asia/Shanghai (CST, +0800)
> System clock synchronized: yes
>               NTP service: active
>           RTC in local TZ: no
> [root@iZbp1jenlv6zmemz4juo9xZ etc]# hwclock
> 2022-10-28 01:08:03.104259+08:00

如果是自定义版本  那这个是正常的  但从arm的版本看  这个时间是一致的  
[root@iZbp1hja6glxg5e8ntui69Z ~]# date
Thu Oct 27 18:02:52 CST 2022
[root@iZbp1hja6glxg5e8ntui69Z ~]# hwclock
2022-10-27 18:02:54.185536+08:00
[root@iZbp1hja6glxg5e8ntui69Z ~]# ls /etc/localtime -l
lrwxrwxrwx. 1 root root 35 Oct 19 20:32 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai