Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 641656 - Timezone offset applied twice at boot
Summary: Timezone offset applied twice at boot
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-19 03:48 UTC by Manuel Garcia Wolff
Modified: 2017-12-22 17:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Garcia Wolff 2017-12-19 03:48:34 UTC
On my new Gentoo system, the timezone offset is applied twice at boot. For example:

1. It is 19:00 local time (UTC-5).
2. I reboot.
3. The system time is initially set to 14:00. Later, the time is corrected by the "init.d/hwclock" script.

This initial wrong setting results in warnings such as: 

==
Clock skew detected with `/etc/init.d'
Adjusting mtime of `/run/openrc/deptree' to Sun Dec 17 12:45:57 2017
==

I followed the Gentoo guides regarding timezone handling. I also asked via IRC and the Forums. Based on that, I think I have configured everything correctly:

==
$ cat /etc/conf.d/hwclock
clock="local"
clock_args=""

# zdump /etc/localtime && date && date -u && /etc/init.d/hwclock show
/etc/localtime  Mon Dec 18 22:29:40 2017 -05
Mon Dec 18 22:29:40 -05 2017
Tue Dec 19 03:29:40 UTC 2017
2017-12-18 22:29:40.404768-0500
==

The output of "init.d/hwclock show" matches the UEFI BIOS date and time. 

To me, it seems like on boot, when setting the system time, the hwclock time is considered UTC instead of localtime.
Comment 1 Jonas Stein gentoo-dev 2017-12-19 18:43:07 UTC
Could you link the forum discussions for completeness here?
The bug tracker aims on bugs in ebuilds. Which ebuild(s) (and versions) do you think have a bug?
Comment 2 Manuel Garcia Wolff 2017-12-19 20:37:26 UTC
> Could you link the forum discussions for completeness here?

Here the link: https://forums.gentoo.org/viewtopic-t-1073968.html

> The bug tracker aims on bugs in ebuilds. Which ebuild(s) (and versions) do you
>  think have a bug?

I do know which Gentoo ebuild causes this problem. I created the bug in this bug tracker, because the instructions state to do so: "Issues concerning packages in Gentoo and other issues that don't fit in any other component"
Comment 3 Manuel Garcia Wolff 2017-12-21 17:04:34 UTC
As detailed in the forums, I was not able to solve the problem. I had to set my BIOS clock to UTC to get rid of the clock skew warnings at boot. 
I am wondering if this could be a bug in OpenRC.

I am not sure how the time setting process works, but I think it is as following:

1. Gentoo boots. The kernel sets the software clock to the value read from the hardware clock. The value is applied as read from the hardware clock, no timezone conversion is applied. So, if your hardware clock is in local time, your software clock is now wrong.

2. Later, "/etc/init.d/hwclock start" is called. This seems to call "settimeofday", which does support timezone conversion. Now, the software clock is correct. 

If this is how the process indeed works, then it seems to me that the "settimeofday" should be called before OpenRC checks if the clock if skewed or not.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2017-12-22 17:34:06 UTC
Assume that if you are the first person to experience this bug, it's probably a local configuration error and not some configuration that should be maintained for all users. We can't fix local problems like yours.

Also, this is not a support forum. You already found two support forums (IRC and the web forums) so there is no reason to inquire about your problem here as well.
Comment 5 Manuel Garcia Wolff 2017-12-22 17:36:57 UTC
I do not agree. I have applied all configurations correctly, as detailed in the forums and also in this bug. If you think this is a configuration problem, then please illustrate here or in the forums which the supposed configuration error is. If there is no configuration problem, then it looks like a bug to me.