Bug 33878 - hwclock не корректно создаёт /etc/adjtime
Summary: hwclock не корректно создаёт /etc/adjtime
Status: NEW
Alias: None
Product: Branch p8
Classification: Distributions
Component: hwclock (show other bugs)
Version: не указана
Hardware: all Linux
: P3 normal
Assignee: Andrey Cherepanov
QA Contact: qa-p8@altlinux.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-12 05:26 MSK by Dmitry A. Kharitonov
Modified: 2017-09-12 05:26 MSK (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry A. Kharitonov 2017-09-12 05:26:49 MSK
user@eeedima ~ 5:16:53> sudo sh -c ':>/etc/adjtime; LANG= hwclock --systohc --localtime --debug; cat /etc/adjtime'      
hwclock from util-linux 2.27.1
Using the /dev interface to the clock.
Last drift adjustment done at 0 seconds after 1969
Last calibration done at 0 seconds after 1969
Hardware clock is on unknown time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2017/09/12 05:17:18
Hw clock time : 2017/09/12 05:17:18 = 1505182638 seconds since 1969
Time since last adjustment is 1505182638 seconds
Calculated Hardware Clock drift is 0.000000 seconds
1505182638.500000 is close enough to 1505182638.500000 (0.000000 < 0.001000)
Set RTC to 1505182638 (1505182638 + 0; refsystime = 1505182638.000000)
Setting Hardware Clock to 05:17:18 = 1505182638 seconds since 1969
ioctl(RTC_SET_TIME) was successful.
Not adjusting drift factor because the --update-drift option was not used.
0.000000 1505182638 0.000000
1505182638
UTC

в последней строке /etc/adjtime должно стоять LOCAL
повторный запуск исправляет положение:

user@eeedima ~ 5:17:18> sudo sh -c 'LANG= hwclock --systohc --localtime --debug; cat /etc/adjtime' 
[sudo] password for user:
hwclock from util-linux 2.27.1
Using the /dev interface to the clock.
Last drift adjustment done at 1505182638 seconds after 1969
Last calibration done at 1505182638 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2017/09/12 05:25:26
Hw clock time : 2017/09/12 05:25:26 = 1505183126 seconds since 1969
Time since last adjustment is 488 seconds
Calculated Hardware Clock drift is 0.000000 seconds
1505183126.500000 is close enough to 1505183126.500000 (0.000000 < 0.001000)
Set RTC to 1505183126 (1505183126 + 0; refsystime = 1505183126.000000)
Setting Hardware Clock to 05:25:26 = 1505183126 seconds since 1969
ioctl(RTC_SET_TIME) was successful.
Not adjusting drift factor because the --update-drift option was not used.
0.000000 1505183126 0.000000
1505183126
LOCAL