chiark / gitweb /
timedated: gather timezone from /etc/localtime sym target
authorShawn Landden <shawnlandden@gmail.com>
Wed, 22 Aug 2012 06:11:26 +0000 (23:11 -0700)
committerLennart Poettering <lennart@poettering.net>
Fri, 14 Sep 2012 17:27:44 +0000 (19:27 +0200)
commit92c4ef2d357baeef78b6f82f119b92f7ed12ac77
tree8a095adc76bd1c85572a2a7f825a045e87f830f2
parentcdefbd6aebc43c89aa1eafacd2edc10b605dfee7
timedated: gather timezone from /etc/localtime sym target

/etc/localtime -> /usr/share/zoneinfo/...

or

/etc/localtime -> ../usr/share/zoneinfo/...

(note, ../usr is not the same if /etc is a symlink, as this isn't
using canonicalize_file_name())

keep other method for now, consider dropping later.

Supporting relative links here are problematic as timezones in
/usr/share/zoneinfo are often themselves symlinks (and symlinks to
symlinks), so this implamentation only supports absolute symlinks
"/usr/share/zoneinfo/" and relative symlinks starting with
"../usr/share/zoneinfo/"

>From TODO (kay sievers):
* kill /etc/timezone handling entirely? What does it provide?
  - /etc/localtime carries the same information already:
      $ ls -l /etc/localtime; cat /etc/timezone
      lrwxrwxrwx 1 root root 33 Jul 27 09:55 /etc/localtime -> /usr/share/zoneinfo/Europe/Berlin
      Europe/Berlin
  - systemd enforces /usr to be available at bootup, so we can
    enforce the use of the symlink
src/timedate/timedated.c