LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Centos7, invalid offset for UTC for Sweden, says UTC+00 (https://www.linuxquestions.org/questions/centos-111/centos7-invalid-offset-for-utc-for-sweden-says-utc-00-a-4175623431/)

Basher52 02-09-2018 11:50 AM

Centos7, invalid offset for UTC for Sweden, says UTC+00
 
Hi all :)

I got a weird error that I don't seem to be able to fix.
I think I tried everything but I can't since it's still invalid.

I use UTC time and the server is in Sweden so the UTC-offset should be +01 but it's +00
The local time was wrong, as it used to be when I use UTC so all other times
I just skipped using UTC and set it myself and then used NTP to adjust it.
With this installation I figured I'm gonna do it right so I set to use UTC but later saw that
the local time was an hour off. After googling about it I found that the hwclock wasn't UTC.
I fixed that but still had problem with correct system time and after fiddling for some hours
trying to fix it I saw this error. I just now tried the GUI to check and yep, the offset for Sweden is corrupt.
Norways and Finlands is correct but Sweden has a +00-offset.
I thought the offset was like hardcoded into each land but it seems it ain't

How the Argh!! do I fix this?


//B52

Basher52 02-09-2018 11:54 AM

Some info:

Code:

[root@webserver01 /]# timedatectl
      Local time: Fri 2018-02-09 17:53:06 UTC
  Universal time: Fri 2018-02-09 17:53:06 UTC
        RTC time: Fri 2018-02-09 17:53:06
      Time zone: Europe/Stockholm (UTC, +0000)
    NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a
[root@webserver01 /]#

Code:

[root@webserver01 /]# hwclock --debug
hwclock from util-linux 2.23.2
Using /dev interface to clock.
Last drift adjustment done at 1518127556 seconds after 1969
Last calibration done at 1518127556 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/02/09 17:53:13
Hw clock time : 2018/02/09 17:53:13 = 1518198793 seconds since 1969
Fri 09 Feb 2018 05:53:13 PM UTC  -0.577709 seconds


michaelk 02-09-2018 03:54 PM

Code:

      Local time: Fri 2018-02-09 17:53:06 UTC
  Universal time: Fri 2018-02-09 17:53:06 UTC
        RTC time: Fri 2018-02-09 17:53:06
      Time zone: Europe/Stockholm (UTC, +0000)

Both local time and the time zone data show UTC versus CET.

What does the output of /etc/localtime show?

zdump -v /etc/localtime | grep 2018

Basher52 02-09-2018 04:03 PM

Code:

zdump -v /etc/localtime | grep 2018
didn't show anything 'cos the
Code:

zdump -v /etc/localtime
gives me
Code:

[root@webserver01 private]# zdump -v /etc/localtime
/etc/localtime  -9223372036854775808 = NULL
/etc/localtime  -9223372036854689408 = NULL
/etc/localtime  9223372036854689407 = NULL
/etc/localtime  9223372036854775807 = NULL

There's no 2018 in that so grep won't find '2018'

michaelk 02-09-2018 04:41 PM

What happens when you run the command

timedatectl set-timezone Europe/Stockholm

What does the output of the date command show?

Basher52 02-09-2018 05:05 PM

Code:

[root@webserver01 private]# timedatectl set-timezone Europe/Stockholm
Code:

[root@webserver01 private]# date
Fri Feb  9 23:04:02 UTC 2018

but the time here is now 00:04

Basher52 02-09-2018 05:09 PM

I think I tried everything, when I set the UTC-time correct and then set the local time (which I thought I could do) with
Code:

timedatectl set-time
everything changes. I have NO CLUE what to do.

michaelk 02-09-2018 05:20 PM

Interesting problem. I don't have a clue either.

I forgot to ask if the following shows the same information as /etc/localtime.
zdump -v /usr/share/zoneinfo/Europe/Stockholm

Basher52 02-09-2018 05:31 PM

I'm not sure how to 'list' /etc/locatime but I did a 'cat' on it... so...

Code:

[root@webserver01 private]# zdump -v /usr/share/zoneinfo/Europe/Stockholm
/usr/share/zoneinfo/Europe/Stockholm  -9223372036854775808 = NULL
/usr/share/zoneinfo/Europe/Stockholm  -9223372036854689408 = NULL
/usr/share/zoneinfo/Europe/Stockholm  9223372036854689407 = NULL
/usr/share/zoneinfo/Europe/Stockholm  9223372036854775807 = NULL
[root@webserver01 private]#

Code:

[root@webserver01 private]# cat /etc/localtime
TZif2UTCTZif2UTC
UTC0


Basher52 02-09-2018 05:36 PM

This thing sure eludes me :mad:
I can't count how many hours I've spent trying to fix this. I just wanted to do it the "correct" way
but I'm starting to think that a reinstall is the only thing that can fix it.

"Weeee", just a "few" hours more to install it all, Sigh!

I'll wait a little longer in case someone that know sees this and answers.

michaelk 02-09-2018 06:16 PM

There was a recent update that included a new tzdata base. If you have not updated recently that could fix problem.

Basher52 02-09-2018 06:41 PM

well there sure are some days ago so...

I did that and got an error, OF COURSE :( :( :(
I got the repo from lux added so that might be the problem. lux is for ulogd.

got this:
Code:

--> Processing Dependency: tinycdb for package: 2:postfix-2.10.1-6.el7.lux.1.x86_64
--> Processing Dependency: libcdb.so.1()(64bit) for package: 2:postfix-2.10.1-6.el7.lux.1.x86_64
--> Finished Dependency Resolution
Error: Package: 2:postfix-2.10.1-6.el7.lux.1.x86_64 (lux)
          Requires: tinycdb
Error: Package: 2:postfix-2.10.1-6.el7.lux.1.x86_64 (lux)
          Requires: libcdb.so.1()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

I think I can skip that for now, like use --skip-broken and later fix this for this particular lux-repo, am I right?

I did see this in the updates to be though:
Code:

...
---> Package tzdata.noarch 0:2017b-1.el7 will be updated
---> Package tzdata.noarch 0:2018c-1.el7 will be an update
---> Package tzdata-java.noarch 0:2017b-1.el7 will be updated
---> Package tzdata-java.noarch 0:2018c-1.el7 will be an update
...

so if this is what you mean, I sure need to get that installed and try again but now this above error showed up.
So what do I do now............




////////////////
For fun I used to say and still do about how I am (and it kinda suits me)
"I'm not a pessimist, I'm an optimistic pessimist.... I know for SURE!!! I'm gonna f**k it up"

michaelk 02-09-2018 06:46 PM

using yum --skip-broken update will not update those broken packages. You could also disable the lux repo.

Correct tzdata is the timezone database.

Basher52 02-09-2018 06:55 PM

OK, I'll disable the lux repo and test that......

Basher52 02-09-2018 10:10 PM

Yep, seemed to fix my error, Thanks michaelk, you're sure 'da man' :cool: :cool: :cool:
wow, I did not see that coming, a bug big as this?!? dang.
I haven't read anything about the update but it sure seemed to fix my problem though.


All times are GMT -5. The time now is 08:01 AM.