Mark Knecht posted on Wed, 06 Jan 2016 07:38:15 -0800 as excerpted:

> The solution to this is eluding me. What changes, other than changing
> /etc/timezone, are required to get a Gentoo machine to recognize that it
> has moved physically and is living in a new timezone?
> 
> I've just moved from Silicon Valley to Tucson, AZ. The machine came up
> fine other than time being off by 1 hour which I expected. I changed
> /etc/timezone from America/Los_Angeles to America/Phoenix and rebooted
> and yet time is still showing California time.
> 
> The system clock is UTC. [snipped]

Welcome to AZ.  I'm in Phoenix.  Talking about time, the really nice 
thing about AZ is that it doesn't do daylight savings time, so you don't 
have to worry about time jumping around twice a year.  =:^)

I first read your message this AM, before work, but while I remembered 
that there was another file to configure, I forgot what it was, and 
didn't have time to look it up, so it had to wait until tonite.

So I just looked it up in the handbook, and thus can point you right at 
it. =:^)

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Timezone

You did the first part of it, setting /etc/timezone, but didn't do the 
second part, setting /etc/localtime, which is used by glibc to know your 
timezone.  You can either do it using the command in the handbook:

emerge --config sys-libs/timezone-data

... or you can do it manually by copying the appropriate timezone file 
from /usr/share/zoneinfo/ to /etc/localtime, for AZ:

cp /usr/share/zoneinfo/America/Phoenix /etc/localtime

(Every time you update the timezone-data package, its pkg_postinst() runs 
pkg_config(), which is what that emerge call does semi-manually, above.  
pkg_config in turn copies the appropriate file to /etc/localtime based 
on /etc/timezone, thus updating /etc/localtime with the timezone file 
from the freshly installed timezone-data package.  The cp alternative 
simply does that same cp manually.  You can of course take a look at the 
timezone-data ebuild itself to see exactly how it does it, if you like.  
It does get slightly fancier with its logic, setting factory if the 
timezone is invalid, not touching the localtime file if it's a symlink 
instead of an actual file, etc, but basically, just does the above under 
normal circumstances. =:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


Reply via email to