1 |
Mark Knecht posted on Wed, 06 Jan 2016 07:38:15 -0800 as excerpted: |
2 |
|
3 |
> The solution to this is eluding me. What changes, other than changing |
4 |
> /etc/timezone, are required to get a Gentoo machine to recognize that it |
5 |
> has moved physically and is living in a new timezone? |
6 |
> |
7 |
> I've just moved from Silicon Valley to Tucson, AZ. The machine came up |
8 |
> fine other than time being off by 1 hour which I expected. I changed |
9 |
> /etc/timezone from America/Los_Angeles to America/Phoenix and rebooted |
10 |
> and yet time is still showing California time. |
11 |
> |
12 |
> The system clock is UTC. [snipped] |
13 |
|
14 |
Welcome to AZ. I'm in Phoenix. Talking about time, the really nice |
15 |
thing about AZ is that it doesn't do daylight savings time, so you don't |
16 |
have to worry about time jumping around twice a year. =:^) |
17 |
|
18 |
I first read your message this AM, before work, but while I remembered |
19 |
that there was another file to configure, I forgot what it was, and |
20 |
didn't have time to look it up, so it had to wait until tonite. |
21 |
|
22 |
So I just looked it up in the handbook, and thus can point you right at |
23 |
it. =:^) |
24 |
|
25 |
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Timezone |
26 |
|
27 |
You did the first part of it, setting /etc/timezone, but didn't do the |
28 |
second part, setting /etc/localtime, which is used by glibc to know your |
29 |
timezone. You can either do it using the command in the handbook: |
30 |
|
31 |
emerge --config sys-libs/timezone-data |
32 |
|
33 |
... or you can do it manually by copying the appropriate timezone file |
34 |
from /usr/share/zoneinfo/ to /etc/localtime, for AZ: |
35 |
|
36 |
cp /usr/share/zoneinfo/America/Phoenix /etc/localtime |
37 |
|
38 |
(Every time you update the timezone-data package, its pkg_postinst() runs |
39 |
pkg_config(), which is what that emerge call does semi-manually, above. |
40 |
pkg_config in turn copies the appropriate file to /etc/localtime based |
41 |
on /etc/timezone, thus updating /etc/localtime with the timezone file |
42 |
from the freshly installed timezone-data package. The cp alternative |
43 |
simply does that same cp manually. You can of course take a look at the |
44 |
timezone-data ebuild itself to see exactly how it does it, if you like. |
45 |
It does get slightly fancier with its logic, setting factory if the |
46 |
timezone is invalid, not touching the localtime file if it's a symlink |
47 |
instead of an actual file, etc, but basically, just does the above under |
48 |
normal circumstances. =:^) |
49 |
|
50 |
-- |
51 |
Duncan - List replies preferred. No HTML msgs. |
52 |
"Every nonfree program has a lord, a master -- |
53 |
and if you use the program, he is your master." Richard Stallman |