You are not logged in.

#1 2013-01-17 08:21:06

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

time zone problem - SOLVED

Hi,

I've switched to systemd and have problem always with my time zone
I'm currently in Tehran so according to the https://wiki.archlinux.org/index.php/Rc.conf I set up:
"Warning: This setting is now configured by the /etc/localtime symlink."

11:32:38 root@baboonsony:/home/papio# ls -la  /etc/localtime
lrwxrwxrwx 1 root root 37 Dec  8 08:59 /etc/localtime -> /usr/share/zoneinfo/posix/Asia/Tehran

every time I start linux it is 3.5 hours ahead (12600 sec)
when I use ntp command it sets up it correctly:

14:54:14 root@baboonsony:/home/papio# /usr/bin/ntpdate  pool.ntp.org
17 Jan 11:26:55 ntpdate[1875]: step time server 62.116.162.126 offset -12593.680916 sec

and then everything is OK

11:37:26 root@baboonsony:/home/papio#  timedatectl status
      Local time: Thu 2013-01-17 11:37:55 IRST
  Universal time: Thu 2013-01-17 08:07:55 UTC
        RTC time: Thu 2013-01-17 11:37:49
        Timezone: posix/Asia/Tehran (IRST, +0330)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Thu 2012-09-20 23:59:59 IRDT
                  Thu 2012-09-20 23:00:00 IRST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Thu 2013-03-21 23:59:59 IRST
                  Fri 2013-03-22 01:00:00 IRDT

how to make sure my time is correctly set up just after boot without ntpdate command?
I have to use localtime as I'm using win7 on the other partition co my /etc/adjtime looks like:

15:18:14 papio@baboonsony:~$ cat /etc/adjtime 
localtime

Last edited by zyghom (2013-01-17 10:21:27)


Zygfryd Homonto

Offline

#2 2013-01-17 08:45:20

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

Re: time zone problem - SOLVED

have you added a time server to ntpd.conf?


Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#3 2013-01-17 08:47:59

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

Re: time zone problem - SOLVED

add the following if not

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org

also I would recommend you follow the wiki article to move to pure systemd

Last edited by t0m5k1 (2013-01-17 08:49:16)


Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#4 2013-01-17 08:50:55

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

hwclock --localtime

Why are you using /usr/share/zoneinfo/posix/Asia/Tehran instead of /usr/share/zoneinfo/Asia/Tehran?

You don't HAVE to use localtime, you can set Windows to use UTC instead.

t0m5k1, his issue has nothing to do with NTP.

Last edited by Scimmia (2013-01-17 08:56:42)

Offline

#5 2013-01-17 08:56:34

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 326

Re: time zone problem - SOLVED

Scimmia wrote:

hwclock --localtime

t0m5k1, his issue has nothing to do with NTP.


I had the exact same issue when I moved to arch because ntp.conf had no servers listed!
what made me think it may help is that he call's the server directly & all is ok, which to me could indicate the file has no servers listed!


Aurora R10 (0TYR0X) - Ryzen 7 5800X - 16GB - RX6700XT 12GB - Hyprland (occasionally XFCE) - AOC Q27G3XMN 1440P
EFI Stub Boot
PROUD XLIBRE USER
Linux User: 401820  Steam-Reddit

Offline

#6 2013-01-17 08:58:12

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

t0m5k1 wrote:
Scimmia wrote:

hwclock --localtime

t0m5k1, his issue has nothing to do with NTP.


I had the exact same issue when I moved to arch because ntp.conf had no servers listed!
what made me think it may help is that he call's the server directly & all is ok, which to me could indicate the file has no servers listed!

But that is still just a band-aid. The system should be able to get the clock very close without using NTP at all. If you have to use NTP to get a correct time, your system has other issues.

Offline

#7 2013-01-17 09:03:32

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: time zone problem - SOLVED

I have changed it to:

16:00:31 root@baboonsony:/home/papio# ls -la /etc/localtime 
lrwxrwxrwx 1 root root 31 Jan 17 12:27 /etc/localtime -> /usr/share/zoneinfo/Asia/Tehran

but just after reboot it is the same 3.5h until I run ntpdate again
it has nothing to do with ntp - I agree
but I have no idea what else to change


Zygfryd Homonto

Offline

#8 2013-01-17 09:05:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

As I said, try hwclock --localtime.

Right now, your system is reading the clock then adding the timezone offset, so it thinks your RTC is in UTC. The above command should tell it otherwise.

Offline

#9 2013-01-17 09:16:02

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: time zone problem - SOLVED

16:11:43 root@baboonsony:/home/papio# hwclock --localtime
Thu 17 Jan 2013 12:41:45 PM IRST  -0.188093 seconds
16:11:58 root@baboonsony:/home/papio# /usr/bin/ntpdate  pool.ntp.org
17 Jan 12:42:18 ntpdate[1264]: step time server 5.9.156.53 offset -12593.654630 sec
12:42:18 root@baboonsony:/home/papio# hwclock --localtime
Thu 17 Jan 2013 12:42:16 PM IRST  -0.641174 seconds
12:42:22 root@baboonsony:/home/papio#

no changes, I still have the same problem: without ntpdate command the computer is using UTC
after ntpdate command the computer changes to IRST


Zygfryd Homonto

Offline

#10 2013-01-17 09:22:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

Did you reboot after running it? Could we get a timedatectl status immediately after boot?

Last edited by Scimmia (2013-01-17 09:23:03)

Offline

#11 2013-01-17 09:22:46

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: time zone problem - SOLVED

yes ;-)


Zygfryd Homonto

Offline

#12 2013-01-17 09:27:27

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

How about trying timedatectl set-local-rtc on

Last edited by Scimmia (2013-01-17 09:27:41)

Offline

#13 2013-01-17 09:34:45

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: time zone problem - SOLVED

executed, no changes at all ;-(

16:31:57 root@baboonsony:/home/papio# timedatectl set-local-rtc ON
16:32:01 root@baboonsony:/home/papio# cat /etc/adjtime 
localtime
16:32:06 root@baboonsony:/home/papio# ls -la /etc/localtime 
lrwxrwxrwx 1 root root 31 Jan 17 12:27 /etc/localtime -> /usr/share/zoneinfo/Asia/Tehran
16:32:14 root@baboonsony:/home/papio# hwclock --localtime
Thu 17 Jan 2013 01:02:30 PM IRST  -0.188010 seconds
16:32:29 root@baboonsony:/home/papio# /usr/bin/ntpdate  pool.ntp.org
17 Jan 13:04:18 ntpdate[1453]: step time server 85.12.35.12 offset -12593.660321 sec
13:04:18 root@baboonsony:/home/papio# 

Zygfryd Homonto

Offline

#14 2013-01-17 09:38:47

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

Maybe there's something wrong with your /etc/adjtime file? Remove it and run hwclock --localtime again to regenerate it.

Starting to look for long shots here.

Offline

#15 2013-01-17 09:43:51

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: time zone problem - SOLVED

16:41:23 root@baboonsony:/home/papio# date
Thu Jan 17 16:41:33 IRST 2013
16:41:33 root@baboonsony:/home/papio# /usr/bin/ntpdate  pool.ntp.org
17 Jan 13:11:54 ntpdate[1282]: step time server 192.34.57.129 offset -12593.603994 sec
13:11:54 root@baboonsony:/home/papio# date
Thu Jan 17 13:11:56 IRST 2013

Zygfryd Homonto

Offline

#16 2013-01-17 09:49:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

Well I'm out of ideas, other than just switching the RTC to UTC.

Offline

#17 2013-01-17 09:49:24

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: time zone problem - SOLVED

13:18:36 root@baboonsony:/home/papio# hwclock --localtime
Thu 17 Jan 2013 01:18:35 PM IRST  -0.094272 seconds
13:18:41 root@baboonsony:/home/papio# cat /etc/adjtime 
cat: /etc/adjtime: No such file or directory

the command above DOES NOT regenerate/recreate this file


Zygfryd Homonto

Offline

#18 2013-01-17 10:13:12

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: time zone problem - SOLVED

And that's part of the problem. If no adjtime file exists, the system assumes UTC and the file you had was invalid. Maybe hwclock --systohc ---localtime will create it?

Last edited by Scimmia (2013-01-17 10:15:15)

Offline

#19 2013-01-17 10:18:25

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: time zone problem - SOLVED

I have found the issue - as Scimmia says - problem with wrong /etc/adjtime file
I found the proper command to recreate it:

13:46:59 root@baboonsony:/etc/cron.hourly# timedatectl set-local-rtc 1
13:47:04 root@baboonsony:/etc/cron.hourly# cat /etc/adjtime
0.0 0 0
0
LOCAL

now it is ok
thank you guys!


Zygfryd Homonto

Offline

Board footer

Powered by FluxBB