You are not logged in.

#1 2015-02-12 14:57:52

gbcbooks
Member
Registered: 2014-12-03
Posts: 25

/etc/localtime is a binary file

circleface wrote:

Does /etc/localtime link to the correct time zone?


any idea why my /etc/localtime is a binary file and it wasn't linked to any file /

-- mod note: split from https://bbs.archlinux.org/viewtopic.php?id=193537 - Trilby --

Last edited by Trilby (2015-02-13 15:37:40)

Offline

#2 2015-02-12 15:03:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: /etc/localtime is a binary file

gbcbooks, please don't try to hijack someone else's thread.  That is a completely unrelated issue - start your own thread if you'd like.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-02-12 16:08:41

snakeroot
Member
Registered: 2012-10-06
Posts: 177

Re: /etc/localtime is a binary file

Is your RTC set to UTC or local time?

Did you set the TZ using timedatectl or in some other fashion?

Are you using timesyncd or ntpd?

Offline

#4 2015-02-13 13:06:45

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: /etc/localtime is a binary file

gbcbooks wrote:
circleface wrote:

Does /etc/localtime link to the correct time zone?


any idea why my /etc/localtime is a binary file and it wasn't linked to any file /

This was true of mine, too. Yet I remember setting the sym link up originally. I moved the old one to localtime.bkup and recreated the symbolic link.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2015-02-13 15:35:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: /etc/localtime is a binary file

Er ... okay.  If the hijack must continue, I'll split it off myself.

If I found a binary /etc/localtime, I'd investigate that file to try to see where it comes from.  What is the output of `file /etc/localtime` (or file /etc/localtime.back or whatever it was moved to)?  If it's ELF, what is the output of objdump?  If not, what is the output of `xxd /etc/localtime | head -1` (or a similar hexdump of the first several bytes)?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2015-02-14 02:26:42

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: /etc/localtime is a binary file

Although I cannot do anymore testing, I can say that I had the same problem.  I set the symlink when installing, but sometime and somehow after that, the actual binary timezone file the link went to got copied over the symlink.  So, it appeared to continue to work since it was still the proper timezone file from /usr/share/zoneinfo.  Unfortunately I just built a new computer and no longer have that old installation, but I can at least say it is a real problem that seems to affect some people, even if I don't know how.

Offline

#7 2015-02-14 02:37:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: /etc/localtime is a binary file

If this is just the target of the link overwriting the link, I'd wonder if the 'victims' of this all have restored from backups and either backed-up or restored improperly.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2015-02-14 03:02:12

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: /etc/localtime is a binary file

I know I personally never restored any backup, but since I also don't know when it changed, it's hard to pin down any specific action that caused it for me.

Offline

#9 2015-02-14 19:29:14

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: /etc/localtime is a binary file

If it sheds any light, here's the systemd page on /etc/localtime and /etc/timezone.

On my system, no packages owns /etc/localtime, and /etc/timezone doesn't exist.

Perhaps those with the issue (or had the issue) could check whether a package accidentally 'owned' /etc/localtime, maybe an AUR package?

Last edited by pypi (2015-02-14 19:29:49)

Offline

#10 2015-02-15 17:21:54

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: /etc/localtime is a binary file

I'm afraid I deleted it. If other people had not reported the same thing, I would have kept it and tried to investigate. Since it did not seem to be an unknown problem, I just removed it and replaced it with a link. I also have an /etc/localtime.bkup which was almost certainly not created manually. That is dated 2014-03-27 and is a binary. At least, less certainly thinks so.

$ file /etc/localtime.bkup 
/etc/localtime.bkup: timezone data, version 2, 7 gmt time flags, 7 std time flags, no leap seconds, 242 transition times, 7 abbreviation chars

No package owns /etc/localtime.

Although I have restored from backup in the past, that was prior to the switch to systemd and I would have definitely done so in a way which restored links etc. correctly. (I used rsync.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2015-02-15 17:36:59

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: /etc/localtime is a binary file

Per the wiki, /etc/localtime should be a symlink to a timezone you specified.  If restoring a backup resolved the symlink, it's just the file you specified.  Example:

% file /etc/localtime 
/etc/localtime: symbolic link to /usr/share/zoneinfo/US/Central

Since timezones change, you should delete the file and restore the symlink to stay current.

Last edited by graysky (2015-02-15 17:39:01)

Offline

#12 2015-02-15 18:15:23

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: /etc/localtime is a binary file

As I say, restoring certainly can't explain the binary in my case. But I already switched it back to a symlink.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2015-02-15 18:37:23

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: /etc/localtime is a binary file

cfr, maybe you made a hard link ("ln") instead of a soft link ("ln -s")? That would explain your file output from the backup file.

Offline

#14 2015-02-15 20:46:35

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: /etc/localtime is a binary file

Morn wrote:

cfr, maybe you made a hard link ("ln") instead of a soft link ("ln -s")? That would explain your file output from the backup file.

It is impossible to say for sure that I didn't make a mistake. However, I am generally paranoid about these things and it would be very unusual for me to make a symbolic link and then not check it using ls -l. But, as I say, I obviously cannot say for certain that I didn't just screw it up.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2015-02-15 23:00:21

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: /etc/localtime is a binary file

It is simply bad usability of the ln command—its default behavior, creating a hard link, is usually not what users want. It's very easy to forget the "-s" switch.

Offline

Board footer

Powered by FluxBB