Gentoo Archives: gentoo-server

From: Benjamin Smee <strerror@g.o>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] UTC vs. localtime
Date: Thu, 11 Aug 2005 10:57:16
Message-Id: 1123757740.27193.10.camel@photon.techops.uk.betfair
In Reply to: Re: [gentoo-server] UTC vs. localtime by Andrew Cowie
1 heya,
2
3 On Thu, 2005-08-11 at 12:51 +1000, Andrew Cowie wrote:
4 > On Tue, 2005-09-08 at 11:58 -0500, Robert Larson wrote:
5 > > I just recently switched a few of my servers to UTC from localtime
6 >
7 > My sense is that the responses you received in this thread, while
8 > helpful, sorta missed the point.
9
10 Agreed! You beat me to the post :)
11
12 > There's no reason for a server to have any system-wide timezone other
13 > than UTC, so yes,
14 >
15 > > /etc/conf.d/clock: CLOCK="UTC"
16 > > /etc/localtime -> /usr/share/zoneinfo/UTC
17 >
18 > is correct. In fact, setting the hardware clock to UTC is most correct
19 > for any Linux system - the only tie to mess with it is if the Linux
20 > installation on a machine co-exists with a broken OS, say, Windows
21 > perhaps.
22 >
23 > But here's the real trick: *any* individual application can localize the
24 > timezone information it gets by [re]setting the TZ environment variable.
25 > And that should be all you have to worry about.
26
27 Precisely the point. It is worth noting though that the root user should
28 never set anything in .bash_profile (or equivalent) to change the TZ
29 var, that should only be done as a user requiring the different time
30 view.
31
32
33 On a different note, while someone mentioned the users of ntp-client and
34 ntpd, it is worth mentioning that openntp doesn't require the same setup
35 as it IS capable of making large adjustments by itself (ie no annoying
36 ntpdate -b before starting) and so you can just add the one init script
37 as supplied. In fact as general I like openntp as a replacement to ntp
38 BUT AFAIK it doesn't have a ntpq equivalent so its hard to know if its
39 actually working and how the different peers are functioning.
40
41 > [P.S. You may have to recorrect the hardware clock *once*, see `hwclock
42 > --help`. Also, be aware that NTP will only act if the skew is within
43 > certain limits, so if you're way out, it won't do anything]
44
45 Also worth noting the option:
46
47 CLOCK_SYSTOHC="yes"
48
49 in /etc/conf.d/clock. This will sync your system time to HW clock on
50 shutdown and is not a bad idea if you are using a NTPd system.
51
52 --
53 gentoo-server@g.o mailing list