[tz] The zoneinfo file system tree structure ?

J William Piggott elseifthen at gmx.com
Thu Feb 12 21:56:55 UTC 2015


[please cc me, I am not subscribed]

Hello,

I have been working on Util-linux' hwclock and other GNU/Linux date-time
issues. I have a couple of questions that I hope someone here can answer.

The tz database file system tree was changed on May 25 1998, moving
'right' and 'posix' from subdirectories of zoneinfo to sibling
directories. However GNU libc continued to use the old structure until
it stopped including the data files on Mar 7 2012. Now some Linux
distributions are still using the old subdirectory tree structure.

Is there a reason that the old tree structure is still being used?

Does it break something to have 'right' and 'posix' as sibling directories?

I ask because the problems that were the catalyst for the change in 1998
are still happening. It seems to me like it was a good solution, but
nobody used it.

If I may ask one more favor, could you please review the information
below which I have added to the hwclock man-page? I still need to
include information about using TZDIR.

Thank you very much,
William


   POSIX vs 'RIGHT'
       A discussion on date-time configuration  would  be  incomplete  without
       addressing  timezones,  this  is  mostly well covered by tzset(3).  One
       area that seems to have no documentation is the  'right'  directory  of
       the IANA Time Zone Database, aka tz, aka zoneinfo.

       There  are  two  separate  databases  in the zoneinfo system, posix and
       'right'. 'Right' (now named leaps) includes leap seconds and posix does
       not.  To  use  the  'right'  database  the System Clock must be kept in
       UTC + leap_seconds, i.e., TAI - 10. This allows calculating  the  exact
       number of seconds between two dates that cross a leap second epoch. The
       System Clock is then converted to the  correct  civil  time,  including
       UTC,  by  using the 'right' timezone files which subtract the leap sec-
       onds. Note: this configuration is considered experimental and is  known
       to have issues.

       To  configure  a  system  to use a particular database all of the files
       located  in  its  directory   must   be   copied   to   the   root   of
       /usr/share/zoneinfo.   Files  are never used directly from the posix or
       'right' subdirectories, e.g., TZ='right/Europe/Dublin'.  This habit was
       becoming  so common that the upstream zoneinfo project restructured the
       system's file tree by moving the posix and 'right'  subdirectories  out
       of the zoneinfo directory and into sibling directories:
         /usr/share/zoneinfo
         /usr/share/posix
         /usr/share/leaps

       Unfortunately, some Linux distributions are changing it back to the old
       tree structure in their packages. So the problem of system  administra-
       tors  reaching  into the 'right' subdirectory persists. This causes the
       system timezone to be configured to  include  leap  seconds  while  the
       zoneinfo  database  is  still  configured to exclude them. Then when an
       application such as a World Clock needs the South_Pole  timezone  file;
       or  an email MTA, or hwclock needs the UTC timezone file; they fetch it
       from the root of /usr/share/zoneinfo , because that is  what  they  are
       supposed  to do. Those files exclude leap seconds, but the System Clock
       now includes them, causing an incorrect time conversion.

       Attempting to mix and match files from these  separate  databases  will
       not work, because they each require the System Clock to use a different
       timescale. The zoneinfo database must be configured to use either posix
       or 'right', as described above.




More information about the tz mailing list