You are not logged in.

#1 2015-12-02 09:21:08

lokesh987
Member
Registered: 2014-12-15
Posts: 43

/etc/localtime symlink changed to a binary file [solved]

Hello

I realised some days ago that the wrong time was presented and started looking into it. I found out that /etc/localtime is a normal file instead of a symlink. Deleted it and created the symlink again, which resulted in immediate correct display of the time. Rebooted and...same again.

A few months ago the same topic was presented ((etc/localtime is a binary file), but the outcome there is not clear to me.

Checked whether I did make a soft link, repeated the procedure and rebooted. .. same again.
Here some info:

timedatectl && sudo hwclock --debug && ls -l /etc/localtime 
      Local time: Wed 2015-12-02 10:12:21 UTC
  Universal time: Wed 2015-12-02 10:12:21 UTC
        RTC time: Wed 2015-12-02 10:12:22
       Time zone: n/a (UTC, +0000)
 Network time on: no
NTP synchronized: no
 RTC in local TZ: no
hwclock from util-linux 2.27
Using the /dev interface to the clock.
Last drift adjustment done at 1427374066 seconds after 1969
Last calibration done at 1427374066 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: 2015/12/02 10:12:23
Hw clock time : 2015/12/02 10:12:23 = 1449051143 seconds since 1969
Time since last adjustment is 21677077 seconds
Calculated Hardware Clock drift is 100186.886417 seconds
Wed 02 Dec 2015 11:12:22 CET  .202405 seconds
-rw-r--r-- 2 root root 2971 Oct  4 12:05 /etc/localtime

I deleted the /etc/localtime once again, created the symlink to my timezone, rebooted and ... perfectly reproducible problem hmm

Any ideas why this is happening?
Lokesh

Last edited by lokesh987 (2015-12-02 11:13:48)

Offline

#2 2015-12-02 10:26:41

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: /etc/localtime symlink changed to a binary file [solved]

I doubt it's the cause of your problem, but your UTC is wrong. Is that a deliberate workaround?

Please post the output that Trilby requested in post #5 in the linked thread.

Also try setting the symlink with datetimectl.

timedatectl set-timezone xxx/xxx

And check the timedatectl service after a reboot, see if there's anything suspicious in the logs.

systemctl status systemd-timedated.service

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2015-12-02 11:00:53

lokesh987
Member
Registered: 2014-12-15
Posts: 43

Re: /etc/localtime symlink changed to a binary file [solved]

Thanks for taking care for this.

WorMzy wrote:

... your UTC is wrong. Is that a deliberate workaround?

Frankly, I have no clue.

WorMzy wrote:

Please post the output that Trilby requested in post #5 in the linked thread.

file /etc/localtime
/etc/localtime: timezone data, version 2, 13 gmt time flags, 13 std time flags, no leap seconds, 184 transition times, 13 abbreviation chars
WorMzy wrote:

And check the timedatectl service after a reboot, see if there's anything suspicious in the logs.

Checked it (without setting the symlink with timedatectl)

systemctl status systemd-timedated.service
● systemd-timedated.service - Time & Date Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-timedated.service; static; vendor preset: disabled)
   Active: inactive (dead) since Wed 2015-12-02 11:15:03 CET; 1h 19min ago
     Docs: man:systemd-timedated.service(8)
           man:localtime(5)
           http://www.freedesktop.org/wiki/Software/systemd/timedated
  Process: 5243 ExecStart=/usr/lib/systemd/systemd-timedated (code=exited, status=0/SUCCESS)
 Main PID: 5243 (code=exited, status=0/SUCCESS)
Dec 02 11:14:33 Arch_Linux systemd[1]: Starting Time & Date Service...
Dec 02 11:14:33 Arch_Linux systemd-timedated[5243]: /etc/localtime should be a symbolic link to a time zone data file in /usr/share/zoneinfo/
Dec 02 11:14:33 Arch_Linux systemd[1]: Started Time & Date Service.

It appears that this system is not active. According to this thread it is not supposed to be started manually. Who turned it off?

I tried your suggestion to set the symlink with timedatectl, which replaced the binary file with a symlink. Lets see after reboot... I'll be back in a minute ....

Offline

#4 2015-12-02 11:12:25

lokesh987
Member
Registered: 2014-12-15
Posts: 43

Re: /etc/localtime symlink changed to a binary file [solved]

So I am back...

After reboot the symlink remains, meaning the time is shown correctly.

The systemd-timedated.service is still inactive:

systemctl -l status systemd-timedated.service
● systemd-timedated.service - Time & Date Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-timedated.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd-timedated.service(8)
           man:localtime(5)
           http://www.freedesktop.org/wiki/Software/systemd/timedated

Notwithstanding, timedatectl spits out the correct local time info:

timedatectl status
      Local time: Wed 2015-12-02 13:06:32 CET
  Universal time: Wed 2015-12-02 12:06:32 UTC
        RTC time: Wed 2015-12-02 12:06:33
       Time zone: Europe/Paris (CET, +0100)
 Network time on: no
NTP synchronized: no
 RTC in local TZ: no

Anyway, this seems to be solved. Thank you very much!

Lokesh

Offline

#5 2015-12-02 11:28:54

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: /etc/localtime symlink changed to a binary file [solved]

Your UTC is still wrong, so your localtime is an hour ahead (it's only 12:28 CET now) , you can fix that with ntpd or systemd-timesyncd.service. Once it's got the correct time, store it in the hardware clock with 'hwclock --systohc --utc'

Don't worry about systemd-timedated.service being disabled, that just means it's not explicitly enabled; it's still run.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2015-12-02 12:06:18

lokesh987
Member
Registered: 2014-12-15
Posts: 43

Re: /etc/localtime symlink changed to a binary file [solved]

WorMzy wrote:

Your UTC is still wrong

How do you know that, is there a way to see this? UTC is 1 hour behind my local time, so it should be correct, right? hmm

But, I did all fixes you proposed, but nothig changed, except that timedatectl no is :

timedatectl status
      Local time: Wed 2015-12-02 12:58:48 CET
  Universal time: Wed 2015-12-02 11:58:48 UTC
        RTC time: Wed 2015-12-02 11:58:48
       Time zone: Europe/Paris (CET, +0100)
 Network time on: no
NTP synchronized: yes
 RTC in local TZ: no

So I can switch of systemd-timesyncd.service again?

Cheers
Lokesh

Offline

#7 2015-12-02 12:30:38

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: /etc/localtime symlink changed to a binary file [solved]

Yes, that's fixed it. As for how I know, well, in your previous post you had "Universal time: Wed 2015-12-02 12:06:32 UTC", but when you posted it, it was only 11:12 UTC. Compare the two timedatectl outputs, you'll see that you've gone back in time an hour.

You can disable systemd-timesyncd if you have no use for it. There's no harm in leaving it enabled though.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2015-12-02 12:45:50

lokesh987
Member
Registered: 2014-12-15
Posts: 43

Re: /etc/localtime symlink changed to a binary file [solved]

Thanks WorMzy,

this tiny bit can be a real pain in some places wink

The "time" - Wiki is not exhaustive to include these commands (yet), but probably this is not only me having this problem.

Cheers again
Lokesh

Offline

Board footer

Powered by FluxBB