Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hardware clock not updated. Two hours behind.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ayeyes
Tux's lil' helper
Tux's lil' helper


Joined: 03 Dec 2017
Posts: 104

PostPosted: Fri Mar 30, 2018 5:01 am    Post subject: Hardware clock not updated. Two hours behind. Reply with quote

Running Chrony, and my system time is correct at boot, but my hardware clock is two hours behind.

I have deleted hwclock from the default runlevel, and it isn't started by any other.

In my hwclock I have

Code:
clock_hctosys="NO"
clock_systohc="YES"


Got this in my kernel:

Code:
Device Drivers --->
      [*] Real Time Clock --->
            [*]   Set system time from RTC on startup and resume
            (rtc0)  RTC used to set the system time
            [*]   Set the RTC time based on NTP synchronization
            (rtc0)  RTC used to synchronize NTP adjustment
            [*]   /sys/class/rtc/rtcN (sysfs)
            [*]   /proc/driver/rtc (procfs for rtc0)
            [*]   /dev/rtcN (character devices)
            <*>   PC-style 'CMOS'


hwclock --verbose

Code:
hwclock from util-linux 2.32
System Time: 1522385689.630061
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1522385687 seconds after 1969
Last calibration done at 1522385687 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2018/03/30 04:54:50
Hw clock time : 2018/03/30 04:54:50 = 1522385690 seconds since 1969
Time since last adjustment is 3 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2018-03-30 06:54:49.622830+02:00


If I set my hardware clock in bios, my software clock is two hours ahead at boot, until Chrony adjusts it.

Code:
hwclock from util-linux 2.32
System Time: 1522387311.320628
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1522386345 seconds after 1969
Last calibration done at 1522386345 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2018/03/30 07:21:52
Hw clock time : 2018/03/30 07:21:52 = 1522394512 seconds since 1969
Time since last adjustment is 8167 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2018-03-30 09:21:51.310272+02:00
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Fri Mar 30, 2018 5:35 am    Post subject: Reply with quote

what is your timezone?

i would recommend setting systohc and hctosys to the same value (probably yes), and possibly setting clock to local (instead of utc, i don't remember what the default is).
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
ayeyes
Tux's lil' helper
Tux's lil' helper


Joined: 03 Dec 2017
Posts: 104

PostPosted: Fri Mar 30, 2018 6:05 am    Post subject: Reply with quote

Thank you for the reply.

It's Europe/Amsterdam. Sat it to local and both to yes, and ran
Code:
hwclock --systohc --localtime
.
Code:

hwclock from util-linux 2.32
System Time: 1522389665.514197
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1522389458 seconds after 1969
Last calibration done at 1522389458 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2018/03/30 06:01:06
Hw clock time : 2018/03/30 06:01:06 = 1522382466 seconds since 1969
Time since last adjustment is -6992 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2018-03-30 06:01:05.497768+02:00


My current time is 08:xx:xx.

When I had

Code:
Device Drivers --->
      [*] Real Time Clock --->
            [ ]   Set system time from RTC on startup and resume
            [ ]   Set the RTC time based on NTP synchronization
            [*]   /sys/class/rtc/rtcN (sysfs)
            [*]   /proc/driver/rtc (procfs for rtc0)
            [*]   /dev/rtcN (character devices)
            <*>   PC-style 'CMOS'


and hwclock to start at boot at runlevel default, and local in hwclock with both to yes, both hardware time and software time was correct.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Fri Mar 30, 2018 6:11 am    Post subject: Reply with quote

Europe/Amsterdam would appear to be utc+2 at the moment, is your timezone being set correctly?

what does `date +%Z` say?
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
ayeyes
Tux's lil' helper
Tux's lil' helper


Joined: 03 Dec 2017
Posts: 104

PostPosted: Fri Mar 30, 2018 6:12 am    Post subject: Reply with quote

date +%Z says CEST.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Fri Mar 30, 2018 7:31 am    Post subject: Reply with quote

That sounds right... if you sync with ntp and reboot it should keep the time correctly... unless I'm missing something. :?
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum