102-500 practice question 21 of 30

What is true about the file /etc/localtime?

Full set: 233 questions
Answer options
A: It is a plain text file containing a string such as Europe/Berlin
B: It is created and maintained by the NTP service based on the location of the system’s IP address.
C: It is a symlink to /sys/device/clock/ltime and always contains the current local time.
D: After changing this file, newtzconfig has to be run to make the changes effective.
E: It is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/Europe/Berlin. Correct answer
Correct Answer:
E. It is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/Europe/Berlin.
Explanation

The /etc/localtime file is used by the system to determine the local timezone. It is a binary data file, not plain text. The standard method for setting the timezone is to make /etc/localtime a symbolic link to the appropriate timezone file from the /usr/share/zoneinfo/ directory tree (e.g., /usr/share/zoneinfo/Europe/Berlin). Alternatively, it can be a direct copy of one of these files. This file contains rules for UTC offset and daylight saving time.

Why Incorrect

A. /etc/localtime is a binary file containing compiled timezone data, not a plain text file with a string.
B. The NTP service synchronizes the system clock's time but does not manage the timezone configuration file.
C. The /sys filesystem is a virtual filesystem for kernel and device information; it does not host timezone data files.
D. newtzconfig is not a standard command. Changes to /etc/localtime are effective for new processes without further commands.

References

- Linux man page localtime(5). It states, "The /etc/localtime file configures the system-wide timezone... It should be a symbolic link to a timezone data file in /usr/share/zoneinfo."

- Red Hat Enterprise Linux 7 System Administrator's Guide, "20.3. Configuring the Time Zone". It specifies that /etc/localtime is "a copy of, or a symbolic link to, a time zone data file from the /usr/share/zoneinfo/ directory."

- Arch Linux Wiki, "System time", section "Time zone". It documents the standard procedure: "create a symlink from /etc/localtime to a zoneinfo file in /usr/share/zoneinfo/."

Scroll to Top