07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The timezone, configured during initial installation, is a configuration item for the tzdata package.<br />

To modify it, use the dpkg-reconfigure tzdata command, which allows you to choose the<br />

timezone to be used in an interactive manner (until lenny, the command to use was tzconfig).<br />

Its configuration is stored in the /etc/timezone file. Additionally, the corresponding file in<br />

the /usr/share/zoneinfo directory is copied in /etc/localtime; this file contains the rules<br />

governing the dates where daylight saving time is active, for countries that use it.<br />

When you need to temporarily change the timezone, use the TZ environment variable, which<br />

takes priority over the configured system default:<br />

$ date<br />

Wed Mar 28 15:51:19 CEST 2012<br />

$ TZ="Pacific/Honolulu" date<br />

Wed Mar 28 03:51:21 HST 2012<br />

NOTE<br />

System clock, hardware<br />

clock<br />

There are two time sources in a computer. A computer's motherboard has a<br />

hardware clock, called the “CMOS clock”. This clock is not very precise, and<br />

provides rather slow access times. The operating system kernel has its own,<br />

the soware clock, which it keeps up to date with its own means (possibly<br />

with the help of time servers, see the “Time Synchronization” section). This<br />

system clock is generally more accurate, especially since it doesn't need access<br />

to hardware variables. However, since it only exists in live memory, it is zeroed<br />

out every time the machine is booted, contrary to the CMOS clock, which has<br />

a baery and therefore “survives” rebooting or halting of the machine. The<br />

system clock is, thus, set from the CMOS clock during boot, and the CMOS<br />

clock is updated on shutdown (to take into account possible changes or corrections<br />

if it has been improperly adjusted).<br />

In practice, there is a problem, since the CMOS clock is nothing more than<br />

a counter and contains no information regarding the time zone. There is a<br />

choice to make regarding its interpretation: either the system considers it<br />

runs in universal time (UTC, formerly GMT), or in local time. This choice<br />

could be a simple shi, but things are actually more complicated: as a result<br />

of daylight saving time, this offset is not constant. The result is that the system<br />

has no way to determine whether the offset is correct, especially around<br />

periods of time change. Since it is always possible to reconstruct local time<br />

from universal time and the timezone information, we strongly recommend<br />

using the CMOS clock in universal time.<br />

Unfortunately, Windows systems in their default configuration ignore this<br />

recommendation; they keep the CMOS clock on local time, applying time<br />

changes when booting the computer by trying to guess during time changes<br />

if the change has already been applied or not. This works relatively well, as<br />

long as the system has only Windows running on it. But when a computer has<br />

several systems (whether it be a “dual-boot” configuration or running other<br />

systems via virtual machine), chaos ensues, with no means to determine if<br />

the time is correct. If you absolutely must retain Windows on a computer,<br />

you should either configure it to keep the CMOS clock as UTC, or deactivate<br />

UTC in the /etc/default/rcS file on the Debian system (and make sure to<br />

manually check your clock in spring and autumn).<br />

168 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!